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

[javascript] parser is too greedy for some new expressions #4068

Open
meraedit opened this issue Apr 29, 2024 · 0 comments
Open

[javascript] parser is too greedy for some new expressions #4068

meraedit opened this issue Apr 29, 2024 · 0 comments

Comments

@meraedit
Copy link
Contributor

Expressions like new a.B().call() are parsed incorrectly as new (singleExpression a.B().call) arguments

I tried to reorder the productions (similarly to #2178), but without success. Adding a semantic predicate fails when generating the parser with "The following sets of rules are mutually left-recursive [singleExpression]".

It seems to me that the only way is to break down the single expression such as the Arguments/call expression cannot follow the new operator: https://262.ecma-international.org/5.1/#sec-11.2
But this is a big change in the grammar...

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