stage1_2/iec.flex
changeset 131 f55ef301e14c
parent 86 1988bf1634da
child 136 32bd7ef40897
--- a/stage1_2/iec.flex	Thu Jul 17 19:07:26 2008 +0200
+++ b/stage1_2/iec.flex	Thu Jul 17 19:07:28 2008 +0200
@@ -1504,13 +1504,18 @@
    * and decrement the line counter acordingly...
    */
   unsigned int i;
+  unsigned int line_number = 0;
+  int before_yylineno = yylineno;
 
   for (i = n; i < strlen(yytext); i++)
     if (yytext[i] == '\n')
-      yylineno--;
+      line_number++;
 
   /* now return all the text back to the input stream... */
   yyless(n);
+  
+  if (line_number > 0 && before_yylineno == yylineno)
+    yylineno = yylineno - line_number;
 }