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

Parse javascript? #563

Closed
bgnx opened this issue Feb 1, 2018 · 3 comments
Closed

Parse javascript? #563

bgnx opened this issue Feb 1, 2018 · 3 comments
Labels

Comments

@bgnx
Copy link

bgnx commented Feb 1, 2018

Issue type

  • Question

Description

Can pegjs grammar represent current javascript grammar? Is there any up to date (or just existing) pegjs grammar for javascript?

@futagoza
Copy link
Member

futagoza commented Feb 1, 2018

You mean a PEG.js generated parser that can parse ES2018+ JavaScript? Although it is possible to make one in the PEG.js grammar (I made a working ES2015 parser 2 years ago, lost now with my broken laptop 😢), currently there is none that I'm aware of, no. But once Stage 1 of #523 is done, it's one of the things I want to get around to doing.

@lauriro
Copy link

lauriro commented Feb 14, 2018

how about example?

@bd82
Copy link

bd82 commented Feb 14, 2018

how about example?

I think that is not a modern (ES2017) ECMAScript grammar.
But could be used as a basis to build upon.

I did try to use this example ES5 grammar in the past but it seems to have kind of choked on anything but very small inputs. So I recommend including a small performance test if/when such a grammar is implemented.

@futagoza futagoza closed this as completed Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants