diff -r 73b56dc69e61 -r 736b36a83548 stage1_2/iec_flex.ll --- a/stage1_2/iec_flex.ll Thu Sep 13 16:35:10 2012 +0200 +++ b/stage1_2/iec_flex.ll Fri Oct 19 12:10:32 2012 +0200 @@ -513,7 +513,7 @@ /* Any other pragma... */ -pragma "{"[^}]*"}" +pragma "{"[^}]*"}"|"{{"([^}]|"}"[^}])*"}}" /* NOTE: this seemingly unnecessary complex definition is required * to be able to eat up comments such as: @@ -849,8 +849,9 @@ /* Any other pragma we find, we just pass it up to the syntax parser... */ /* Note that the state is exclusive, so we have to include it here too. */ {pragma} {/* return the pragmma without the enclosing '{' and '}' */ - yytext[strlen(yytext)-1] = '\0'; - yylval.ID=strdup(yytext+1); + uint cut = yytext[1]=='{'?2:1; + yytext[strlen(yytext)-cut] = '\0'; + yylval.ID=strdup(yytext+cut); return pragma_token; } {pragma} {/* return the pragmma without the enclosing '{' and '}' */