changeset 701 | 562c01f82afb |
parent 637 | 1b6f337222e0 |
child 793 | 268bf4ca5fa1 |
--- a/stage1_2/iec_flex.ll Thu Oct 25 11:09:06 2012 +0200 +++ b/stage1_2/iec_flex.ll Wed Oct 31 19:21:09 2012 +0100 @@ -855,8 +855,9 @@ return pragma_token; } <body_state>{pragma} {/* return the pragmma without the enclosing '{' and '}' */ - yytext[strlen(yytext)-1] = '\0'; - yylval.ID=strdup(yytext+1); + int cut = yytext[1]=='{'?2:1; + yytext[strlen(yytext)-cut] = '\0'; + yylval.ID=strdup(yytext+cut); return pragma_token; }