# HG changeset patch # User Mario de Sousa # Date 1307117664 -3600 # Node ID 8fcea60029def71cd3f9f06b9aeab4c1197f38af # Parent f111a6986c22382712fc1d3c63928609c57de125 Allow [EOL] after a label in IL. diff -r f111a6986c22 -r 8fcea60029de stage1_2/iec.y --- a/stage1_2/iec.y Wed Jun 01 14:02:16 2011 +0200 +++ b/stage1_2/iec.y Fri Jun 03 17:14:24 2011 +0100 @@ -6197,6 +6197,8 @@ {$$ = new il_instruction_c(NULL, $1, locloc(@$));} | label ':' il_incomplete_instruction eol_list {$$ = new il_instruction_c($1, $3, locloc(@$));} +| label ':' eol_list + {$$ = new il_instruction_c($1, NULL, locloc(@$));} /* ERROR_CHECK_BEGIN */ | error eol_list {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid IL instruction."); yyerrok;} diff -r f111a6986c22 -r 8fcea60029de stage4/generate_c/generate_c_il.cc --- a/stage4/generate_c/generate_c_il.cc Wed Jun 01 14:02:16 2011 +0200 +++ b/stage4/generate_c/generate_c_il.cc Fri Jun 03 17:14:24 2011 +0100 @@ -751,7 +751,9 @@ s4o.print(":\n"); s4o.print(s4o.indent_spaces); } - symbol->il_instruction->accept(*this); + if (NULL != symbol->il_instruction) { + symbol->il_instruction->accept(*this); + } return NULL; } diff -r f111a6986c22 -r 8fcea60029de stage4/generate_iec/generate_iec.cc --- a/stage4/generate_iec/generate_iec.cc Wed Jun 01 14:02:16 2011 +0200 +++ b/stage4/generate_iec/generate_iec.cc Fri Jun 03 17:14:24 2011 +0100 @@ -1530,7 +1530,9 @@ symbol->label->accept(*this); s4o.print(": "); } - symbol->il_instruction->accept(*this); + if (symbol->il_instruction != NULL) { + symbol->il_instruction->accept(*this); + } return NULL; }