X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Fparsergen.mdc;h=df73f513ceec725931af6c78832d234a0913e45a;hp=76fec3a70a779cefe4589a9d79e861a61acd726e;hb=35d743c48140ea96fa56c3f63ee8dd0e032cbb2d;hpb=ca00beb39b9d02578c1f0b556a2c2f70f28cf6e7 diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index 76fec3a..df73f51 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -2871,9 +2871,13 @@ checks if a given token is in any of these look-ahead sets. force_reduce: if (states[tos->state].reduce_prod >= 0 && states[tos->state].newline_only && - tk->num != TK_newline && tk->num != TK_eof && tk->num != TK_out) { - /* Anything other than newline in an error as this - * production must end at EOL + !(tk->num == TK_newline || + tk->num == TK_eof || + tk->num == TK_out || + (tos->indents == 0 && tos->since_newline == 0))) { + /* Anything other than newline or out or eof + * in an error unless we are already at start + * of line, as this production must end at EOL. */ } else if (states[tos->state].reduce_prod >= 0) { void **body;