]> git.saurik.com Git - bison.git/commitdiff
(YY_USER_INIT): Initialize code_start, too.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 13 Mar 2003 07:07:17 +0000 (07:07 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 13 Mar 2003 07:07:17 +0000 (07:07 +0000)
(<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
cursor, instead of leaving it undefined.  This fixes a bug
reported by Tim Van Holder in
<http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.

src/scan-gram.l

index a31cd02e83e26d5c78a7ac8a42a3c5db6aded7f6..77fe5beb63823a7595e0423110c49565135a221f 100644 (file)
@@ -43,6 +43,7 @@
       scanner_cursor.file = current_file;              \
       scanner_cursor.line = 1;                         \
       scanner_cursor.column = 1;                       \
+      code_start = scanner_cursor;                     \
     }                                                  \
   while (0)
 
@@ -279,6 +280,11 @@ splice      (\\[ \f\t\v]*\n)*
   . {
     complain_at (*loc, _("invalid character: %s"), quote (yytext));
   }
+
+  <<EOF>> {
+    loc->start = loc->end = scanner_cursor;
+    yyterminate ();
+  }
 }
 
 
@@ -529,6 +535,8 @@ splice       (\\[ \f\t\v]*\n)*
        return token_type;
       }
   }
+
+  <<EOF>>  unexpected_end_of_file (scanner_cursor, "{}");
 }