From: Nick Bowler Date: Fri, 21 Jul 2023 03:23:00 +0000 (-0400) Subject: libcdecl: Remove magic T_ENGLISH token. X-Git-Tag: v1.3~103 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/b9035928d16d032db1882d54ecb481352bd56047 libcdecl: Remove magic T_ENGLISH token. This token is pointless, all english syntax is already sufficiently distinguished by the T_DECLARE and T_TYPE tokens, which are only returned by the scanner in english mode. --- diff --git a/src/parse.y b/src/parse.y index f507d5b..fd5776e 100644 --- a/src/parse.y +++ b/src/parse.y @@ -188,7 +188,6 @@ static struct cdecl *insert_identifier(struct cdecl *decl, char *ident) /* Magic tokens */ %token T_LEX_ERROR -%token T_ENGLISH %token T_IDENT "identifier" %token T_UINT "integer constant" @@ -274,8 +273,8 @@ static struct cdecl *insert_identifier(struct cdecl *decl, char *ident) %% -input: T_ENGLISH english { - *out = $2; +input: english { + *out = $1; } | declaration { *out = $1; }; diff --git a/src/scan.l b/src/scan.l index 767ba22..8a6572e 100644 --- a/src/scan.l +++ b/src/scan.l @@ -124,11 +124,6 @@ INTEGER 0x[[:xdigit:]]+|0[0-7]+|[[:digit:]]+ %{ char *c; - - if (yyextra > 0) { - yyextra = -yyextra; - return T_ENGLISH; - } %} "..."|[][;*(),] {