archives

« Bugzilla Issues Index

#2189 — 13.7 continue, 13.8 break: Pass "yield" parameter to IdentifierReference production


13.7 The continue Statement
13.8 The break Statement

Pass "yield" parameter to IdentifierReference and remove the production rule for "[~yield]" in ContinueStatement and BreakStatement.

Reasoning:

12.1.2:
IdentifierReference[yield] :
Identifier
[~yield] yield

13.8:
BreakStatement[yield]:
break IdentifierReference ;
[~yield] break yield ;


Per 5.1.5, IdentifierReference[yield] expands to:

IdentifierReference :
Identifier
yield

IdentifierReferenceYield :
Identifier


And BreakStatement[yield] expands to:

BreakStatement:
break IdentifierReference ;
break yield ;

BreakStatementYield:
break IdentifierReference ;


Combining these rules gives:

BreakStatement:
break Identifier ;
break yield ;
break yield ;

BreakStatementYield:
break Identifier ;
break yield ;


Which looks wrong, I'd expect these rules:

BreakStatement:
break Identifier ;
break yield ;

BreakStatementYield:
break Identifier ;


fixed in rev21 editor's draft


fixed in rev21 draft