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

Missing semi-colon in for grammar #924

Closed
pvdz opened this Issue May 29, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@pvdz

pvdz commented May 29, 2017

The IterationStatement (link) has this rule:

for(Lexical Declaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt; Expression[+In, ?Yield, ?Await]opt) Statement[?Yield, ?Await, ?Return]

While that initially got me excited I've since then recovered and am fairly certain it's just missing the first semi-colon in the grammar.

This bug is present in every appearance of this rule (about 13x, search for LexicalDeclaration Expression) and was at least present since ES6.

Trivial fix.

@pvdz

This comment has been minimized.

Show comment
Hide comment
@pvdz

pvdz May 29, 2017

I would like to point out that there's a unique opportunity here to define a "simple" loop where you define the start and finish of a var without, technically, introducing new syntax. for (let i 80; 100) log(i)

pvdz commented May 29, 2017

I would like to point out that there's a unique opportunity here to define a "simple" loop where you define the start and finish of a var without, technically, introducing new syntax. for (let i 80; 100) log(i)

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan May 29, 2017

Member

@qfox Where do you think the missing semicolon is? LexicalDeclaration's grammar has a semicolon in it.

It's true that this is a possibility for a new language feature, but such a new feature will have to be proposed separately.

Member

littledan commented May 29, 2017

@qfox Where do you think the missing semicolon is? LexicalDeclaration's grammar has a semicolon in it.

It's true that this is a possibility for a new language feature, but such a new feature will have to be proposed separately.

@pvdz

This comment has been minimized.

Show comment
Hide comment
@pvdz

pvdz May 29, 2017

(That last bit was a joke)

The grammar is

for(LexicalDeclaration Expression; Expression) Statement

I'm pretty sure that should be

for(LexicalDeclaration; Expression; Expression) Statement

pvdz commented May 29, 2017

(That last bit was a joke)

The grammar is

for(LexicalDeclaration Expression; Expression) Statement

I'm pretty sure that should be

for(LexicalDeclaration; Expression; Expression) Statement
@pvdz

This comment has been minimized.

Show comment
Hide comment
@pvdz

pvdz May 29, 2017

Oh, I see now. Okay.

pvdz commented May 29, 2017

Oh, I see now. Okay.

@pvdz pvdz closed this May 29, 2017

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan May 29, 2017

Member

@qfox I'm glad to have you carefully reviewing the ECMAScript spec, even if this ended up being OK already. I hope you keep on the lookout for anything that we could fix or make more clear!

Member

littledan commented May 29, 2017

@qfox I'm glad to have you carefully reviewing the ECMAScript spec, even if this ended up being OK already. I hope you keep on the lookout for anything that we could fix or make more clear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment