# HG changeset patch
# User Laurent Bessard
# Date 1351707669 -3600
# Node ID 562c01f82afbed9034a0b54330119344ea207410
# Parent  f0ef73eceb5761031f42240296bfb1eab33cac78
Fix pragma with double bracket token stripping

diff -r f0ef73eceb57 -r 562c01f82afb stage1_2/iec_flex.ll
--- 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;
 		}