--- 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 <body_state> 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;
}
<body_state>{pragma} {/* return the pragmma without the enclosing '{' and '}' */