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 with "Unsyntactic continue" when continue target is closer than closest loop #58

Closed
michaelficarra opened this issue Sep 2, 2013 · 3 comments

Comments

@michaelficarra
Copy link

Smallest failing case

for(;;){ a: continue a; }

These related programs both parse fine

for(;;){ a: break a; }
a: for(;;){ continue a; }

Discovered by esfuzz generative testing.

@marijnh
Copy link
Member

marijnh commented Sep 2, 2013

As I understand it, continue can only refer to a loop, so your example is indeed a syntax error. You can break arbitrary labels, but not continue them (thought that would be neat, allowing pretty much arbitrary goto).

@rvanvelzen
Copy link

continue indeed may only have an Identifier referring to an enclosing IterationStatement, whereas break refers to an enclosing Statement. The first example appears to be syntactically incorrect.

@michaelficarra
Copy link
Author

@rvanvelzen: I reread that portion of the spec and I agree with your assessment. It seems the other parsers were wrongly accepting that program.

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

No branches or pull requests

3 participants