Print a more user-friendly error message for leftover diff marks (#1089)

This commit is contained in:
Eldred Habert
2022-10-03 16:50:32 +02:00
committed by ISSOtm
parent 74e40654e6
commit e2136d60b2

View File

@@ -690,17 +690,19 @@ asmfile : lines
;
lines : %empty
| lines line
| lines opt_diff_mark line
;
endofline : T_NEWLINE | T_EOB
;
plain_directive : label
| label cpu_command
| label macro
| label directive
| assignment_directive
opt_diff_mark : %empty // OK
| T_OP_ADD {
error("syntax error, unexpected + at the beginning of the line (is it a leftover diff mark?)\n");
}
| T_OP_SUB {
error("syntax error, unexpected - at the beginning of the line (is it a leftover diff mark?)\n");
}
;
line : plain_directive endofline
@@ -786,6 +788,13 @@ else : T_POP_ELSE T_NEWLINE {
}
;
plain_directive : label
| label cpu_command
| label macro
| label directive
| assignment_directive
;
endc : T_POP_ENDC {
lexer_DecIFDepth();
}