Minimal error recovery.

No more bailing on the first syntax error. While the recovery is not
perfect (things can get right twisted), qfcc will now continue parsing
after a syntax error.
This commit is contained in:
Bill Currie 2010-12-31 16:01:09 +09:00
parent a4635d79e8
commit dc5bafb8fb

View file

@ -225,6 +225,9 @@ defs
: /* empty */
| defs {if (current_class) PARSE_ERROR;} def
| defs obj_def
| error END { current_class = 0; yyerrok; }
| error ';' { yyerrok; }
| error '}' { yyerrok; }
;
def
@ -796,6 +799,7 @@ statements
statement
: ';' { $$ = 0; }
| error ';' { $$ = 0; yyerrok; }
| statement_block { $$ = $1; }
| RETURN opt_expr ';'
{