: { driver.Warning(yylloc, "warning, automatic semi-colon insertion required"); }
;
-Terminator_
- : ";"
- | "\n" StrictSemi
- ;
-
Terminator
- : Terminator_
+ : ";"
| error { if (yychar != yyeof_ && yychar != token::CloseBrace && !yylval.newline_) YYABORT; else { yyerrok; driver.errors_.pop_back(); } } StrictSemi
;
TerminatorOpt
- : Terminator_
+ : ";"
| error { yyerrok; driver.errors_.pop_back(); } StrictSemi
;
/* 11.2 Left-Hand-Side Expressions {{{ */
MemberAccess
: "[" LexPushInOff Expression LexPopIn "]" { $$ = CYNew CYDirectMember(NULL, $3); }
- | "." Identifier { $$ = CYNew CYDirectMember(NULL, CYNew CYString($2)); }
+ | "." IdentifierName { $$ = CYNew CYDirectMember(NULL, CYNew CYString($2)); }
| "." AutoComplete { driver.mode_ = CYDriver::AutoDirect; YYACCEPT; }
;
/* 12.7 The continue Statement {{{ */
ContinueStatement
- : "continue" IdentifierOpt Terminator { $$ = CYNew CYContinue($2); }
+ : "continue" "\n" StrictSemi { $$ = CYNew CYContinue(NULL); }
+ | "continue" IdentifierOpt Terminator { $$ = CYNew CYContinue($2); }
;
/* }}} */
/* 12.8 The break Statement {{{ */
BreakStatement
- : "break" IdentifierOpt Terminator { $$ = CYNew CYBreak($2); }
+ : "break" "\n" StrictSemi { $$ = CYNew CYBreak(NULL); }
+ | "break" IdentifierOpt Terminator { $$ = CYNew CYBreak($2); }
;
/* }}} */
/* 12.9 The return Statement {{{ */
ReturnStatement
- : "return" ExpressionOpt Terminator { $$ = CYNew CYReturn($2); }
+ : "return" "\n" StrictSemi { $$ = CYNew CYReturn(NULL); }
+ | "return" ExpressionOpt Terminator { $$ = CYNew CYReturn($2); }
;
/* }}} */
/* 12.10 The with Statement {{{ */
/* }}} */
/* 12.13 The throw Statement {{{ */
ThrowStatement
- : "throw" Expression Terminator { $$ = CYNew cy::Syntax::Throw($2); }
+ : "throw" "\n" StrictSemi { YYABORT; }
+ | "throw" Expression Terminator { $$ = CYNew cy::Syntax::Throw($2); }
;
/* }}} */
/* 12.14 The try Statement {{{ */
MemberAccess
: "->" "[" Expression "]" { $$ = CYNew CYIndirectMember(NULL, $3); }
- | "->" Identifier { $$ = CYNew CYIndirectMember(NULL, CYNew CYString($2)); }
+ | "->" IdentifierName { $$ = CYNew CYIndirectMember(NULL, CYNew CYString($2)); }
| "->" AutoComplete { driver.mode_ = CYDriver::AutoIndirect; YYACCEPT; }
;
/* }}} */