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

Fails to parse ("a") #3242

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

Fails to parse ("a") #3242

lydell opened this issue Jan 22, 2017 · 1 comment

Comments

@lydell
Copy link

lydell commented Jan 22, 2017

~/bugs/flow-parens-string-bug  
❯ node --version
v7.2.0

~/bugs/flow-parens-string-bug  
❯ npm i flow-parser
/home/lydell/bugs/flow-parens-string-bug
└─┬ flow-parser@0.38.0 
  ├── ast-types@0.8.18 
  ├── colors@1.1.2 
  └── minimist@1.2.0 


~/bugs/flow-parens-string-bug  
❯ node
> try { require('flow-parser').parse('("a")') } catch (e) { console.log('err', e) }
err [ 0,
  [ 248, aw { t: 0, c: 'Failure', l: 7 }, -3 ],
  aw { t: 0, c: 'Nooo: T_LPAREN\n', l: 15 } ]
undefined
> 

Expectations:

  • No error to be thrown. (And if one were to be thrown, I'd expect a real
    Error to be thrown, not an Array.)
  • An AST to be returned.

The non-JS version of the parser seems to have the same problem:

~/bugs/flow-parens-string-bug  
❯ npm i flow-bin
/home/lydell/bugs/flow-parens-string-bug
└── flow-bin@0.38.0 


~/bugs/flow-parens-string-bug  
❯ echo '("a")' | flow ast --pretty
Unhandled exception: Failure("Nooo: T_LPAREN\n")
@vkurchatkin
Copy link
Contributor

Duplicate of #3234

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

2 participants