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;