]> git.saurik.com Git - bison.git/blobdiff - src/scan-gram.l
bison: catch bad symbol names.
[bison.git] / src / scan-gram.l
index 5d4b4b306f20746ba1885b6487c3b6ca15b19d12..7c5b6000e9b0d54851eea1f47ef31c22659aa230 100644 (file)
@@ -240,6 +240,12 @@ splice      (\\[ \f\t\v]*\n)*
     return INT;
   }
 
+  /* Identifiers may not start with a digit.  Yet, don't silently
+     accept "1FOO" as "1 FOO".  */
+  {int}{id} {
+    complain_at (*loc, _("invalid identifier: %s"), quote (yytext));
+  }
+
   /* Characters.  We don't check there is only one.  */
   "'"        STRING_GROW; token_start = loc->start; BEGIN SC_ESCAPED_CHARACTER;