mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
examples: bistromathic: demonstrate error recovery
* examples/c/bistromathic/parse.y: here. * examples/c/bistromathic/bistromathic.test: Check it. Included a stupid case where the error is actually ignored.
This commit is contained in:
@@ -146,6 +146,7 @@ exp:
|
||||
| "-" exp %prec NEG { $$ = -$2; }
|
||||
| exp[l] "^" exp[r] { $$ = pow ($l, $r); }
|
||||
| "(" exp ")" { $$ = $2; }
|
||||
| "(" error ")" { $$ = 666; }
|
||||
;
|
||||
|
||||
// End of grammar.
|
||||
|
||||
Reference in New Issue
Block a user