stage1_2/iec_flex.ll
changeset 793 268bf4ca5fa1
parent 761 7b52623a2f37
parent 701 562c01f82afb
child 822 a7d9e0b8636b
child 866 c8c48ab075e0
--- a/stage1_2/iec_flex.ll	Thu Jan 03 17:04:04 2013 +0000
+++ b/stage1_2/iec_flex.ll	Thu Jan 03 18:23:07 2013 +0000
@@ -522,7 +522,7 @@
 
 /* Any other pragma... */
 
-pragma "{"[^}]*"}"
+pragma "{"[^}]*"}"|"{{"([^}]|"}"[^}])*"}}"
 
 /* NOTE: this seemingly unnecessary complex definition is required
  *       to be able to eat up comments such as:
@@ -859,13 +859,15 @@
 	/* 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);
+         int 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 '}' */
-		 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;
 		}