From: Nick Bowler Date: Thu, 22 Feb 2024 03:31:01 +0000 (-0500) Subject: libcdecl: Use an explicit name for T_LEX_ERROR. X-Git-Tag: v1.3~10 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/da87235fd91665373a44dbc75b1750deaaf81abe?hp=318e941af5ec3b0622212ba3d2968efd3c961587 libcdecl: Use an explicit name for T_LEX_ERROR. 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. --- diff --git a/src/parse.y b/src/parse.y index 87d3f45..6f3b304 100644 --- a/src/parse.y +++ b/src/parse.y @@ -272,7 +272,7 @@ static struct cdecl_declarator *nulldecl(void) %destructor { free_decl($$); } /* Magic tokens */ -%token T_LEX_ERROR +%token T_LEX_ERROR "@@@" %token T_IDENT "identifier" %token T_UINT "integer constant" diff --git a/tests/internal.at b/tests/internal.at index b35477a..5fef623 100644 --- a/tests/internal.at +++ b/tests/internal.at @@ -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 ]])