X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani.mdc;h=a8653cc669adbe9ee21d894ecb9744e99b46ce66;hp=f36bbdb13593c6c306920bacd7d1d619513c2957;hb=4477bdf961f98ec3143743684eafba45a2e29287;hpb=a98df22daa1e3e2ef80ecea149cbe286ff7fdbf1 diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index f36bbdb..a8653cc 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -2067,6 +2067,7 @@ function will be needed. $0->f.type = $<3; $0->f.init = val_init($3); }$ + | ERROR ${ tok_err(c, "Syntax error in struct field", &$1); }$ ###### forward decls static void structure_print_type(struct type *t, FILE *f); @@ -3074,6 +3075,7 @@ is in-place. | SimpleStatements ; ${ $0 = $<1; }$ SimpleStatement -> pass ${ $0 = NULL; }$ + | ERROR ${ tok_err(c, "Syntax error in statement", &$1); }$ ## SimpleStatement Grammar ###### print binode cases @@ -3917,6 +3919,10 @@ various declarations in the parse context. | DeclareProgram | DeclareStruct | NEWLINE + | ERROR NEWLINE ${ + tok_err(c, + "error: unhandled parse error", &$1); + }$ ## top level grammar @@ -3990,6 +3996,7 @@ searching through for the Nth constant for decreasing N. v->val = interp_exec($5); } } }$ + | ERROR NEWLINE ${ tok_err(c, "Syntax error in constant", &$1); }$ ###### print const decls { @@ -4058,7 +4065,7 @@ analysis is a bit more interesting at this level. $0->left = reorder_bilist($<3); $0->right = $<4; var_block_close(c, CloseSequential); - if (c->scope_stack) abort(); + if (c->scope_stack && !c->parse_error) abort(); }$ | ERROR ${ tok_err(c,