Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow parser cannot parse simple Literal in Parenthesis. #3234

Closed
danez opened this issue Jan 22, 2017 · 1 comment
Closed

Flow parser cannot parse simple Literal in Parenthesis. #3234

danez opened this issue Jan 22, 2017 · 1 comment
Assignees

Comments

@danez
Copy link
Contributor

danez commented Jan 22, 2017

The following code makes the flow-parser fail. All other parsers have no problem with it.

("not a directive");

The message I receive is:

Non-error thrown with value: [ 0,
  [ 248, aw { t: 0, c: 'Failure', l: 7 }, -3 ],
  aw { t: 0, c: 'Nooo: T_LPAREN\n', l: 15 },

ASTExplorer with flow also fails (see dev console):
http://astexplorer.net/#/2DM4QE8FCf

Noticed this while working on babel/babylon#277 and using the flow-parser as reference parser to compare the ast from babylon to.

@mroch
Copy link
Contributor

mroch commented Jan 23, 2017

thanks, will fix this before 0.39!

yamafaktory added a commit to yamafaktory/prettier that referenced this issue Feb 4, 2017
vjeux pushed a commit to prettier/prettier that referenced this issue Feb 4, 2017
* Add parentheses if node is StringLiteral surrounded by ExpressionStatement :tools:.

* Add new test.

* Update tests to run against Babylon, plus no regression case.

* Split actual test and no regression test in two files.

* Disable Flow till facebook/flow#3234 is merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants