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

sanitycheck: parse ecma2020 constructs (??) #3653

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobrippling
Copy link
Collaborator

To help with PRs such as #3642

@bobrippling
Copy link
Collaborator Author

bobrippling commented Nov 11, 2024

@gfwilliams this PR assumes we can parse all syntaxes from the 2020 edition

return str => parser.parse(str, { ecmaVersion: 2020 });

... but I don't think that's the case (e.g. destructuring isn't supported), so I have two questions:

  1. Is there a list anywhere of what's supported and what isn't?
  2. Does this matter or do we just accept that we might pass some things through sanitycheck which then fail to parse on-device? Or vice-versa, we only enable ?? parsing and possibly other things espruino supports (based on the above list)

@gfwilliams
Copy link
Member

Is there a list anywhere of what's supported and what isn't?

https://www.espruino.com/Features

I guess ideally it'd be really nice to throw errors for unsupported stuff. Is there a 'visitor' for acorn maybe, so we can iterate over everything in the syntax tree and check for unsupported stuff that gets parsed (eg spread I guess)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants