YYABORT; \
} while (false)
+#define CYEOK() do { \
+ yyerrok; \
+ driver.errors_.pop_back(); \
+} while (false)
+
#define CYNOT(location) \
CYERR(location, "unimplemented feature")
+#define CYMPT(location) do { \
+ if (!yyla.empty() && yyla.type_get() != yyeof_) \
+ CYERR(location, "unexpected lookahead"); \
+} while (false)
+
}
%name-prefix "cy"
;
LexNewLine
- : { if (!yyla.empty() && yyla.type_get() != yyeof_) CYERR(@$, "unexpected lookahead"); driver.next_ = true; }
+ : { CYMPT(@$); driver.next_ = true; }
;
LexNoStar
Terminator
: ";"
- | error { if (yyla.type_get() != yyeof_ && yyla.type != yytranslate_(token::CloseBrace) && driver.newline_ == CYDriver::NewLineNone) { CYERR(@1, "required semi-colon"); } else { yyerrok; driver.errors_.pop_back(); } } StrictSemi
+ | error { if (yyla.type_get() != yyeof_ && yyla.type != yytranslate_(token::CloseBrace) && driver.newline_ == CYDriver::NewLineNone) CYERR(@1, "required semi-colon"); else CYEOK(); } StrictSemi
;
TerminatorOpt