]> git.draconx.ca Git - cdecl99.git/commitdiff
libcdecl: Use an explicit name for T_LEX_ERROR.
authorNick Bowler <nbowler@draconx.ca>
Thu, 22 Feb 2024 03:31:01 +0000 (22:31 -0500)
committerNick Bowler <nbowler@draconx.ca>
Thu, 22 Feb 2024 03:31:01 +0000 (22:31 -0500)
The name of this token doesn't have to be anything in particular,
just something that won't appear in a real error message.  So we
can use a short string to reduce the string table size.

src/parse.y
tests/internal.at

index 87d3f45e0a7c720436b287faab828b85e6f25def..6f3b3044584c4cf8ccf3a4be8f13d0bdf6e798d8 100644 (file)
@@ -272,7 +272,7 @@ static struct cdecl_declarator *nulldecl(void)
 %destructor { free_decl($$); }       <decl>
 
 /* Magic tokens */
-%token T_LEX_ERROR
+%token T_LEX_ERROR "@@@"
 
 %token <item>    T_IDENT "identifier"
 %token <uintval> T_UINT  "integer constant"
index b35477a82c304087fbeba5af3a769aab87e888ee..5fef623833bc672682ee9273603d8861c350ada2 100644 (file)
@@ -139,13 +139,13 @@ integer constant 4294967295
 integer constant 4294967295
 integer constant 4294967295
 eof
-T_LEX_ERROR
+@@@
 eof
-T_LEX_ERROR
+@@@
 eof
-T_LEX_ERROR
+@@@
 eof
-T_LEX_ERROR
+@@@
 eof
 ]])