From da87235fd91665373a44dbc75b1750deaaf81abe Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 21 Feb 2024 22:31:01 -0500 Subject: [PATCH] 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. --- src/parse.y | 2 +- tests/internal.at | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 ]]) -- 2.43.2