]> git.draconx.ca Git - cdecl99.git/commitdiff
libcdecl: Remove magic T_ENGLISH token.
authorNick Bowler <nbowler@draconx.ca>
Fri, 21 Jul 2023 03:23:00 +0000 (23:23 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 21 Jul 2023 03:23:00 +0000 (23:23 -0400)
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.

src/parse.y
src/scan.l

index f507d5b6ee106e163f7c98a0e31150c906672efa..fd5776ede27596b488d34a7cf113811113eade9a 100644 (file)
@@ -188,7 +188,6 @@ static struct cdecl *insert_identifier(struct cdecl *decl, char *ident)
 
 /* Magic tokens */
 %token T_LEX_ERROR
-%token T_ENGLISH
 
 %token <strval> T_IDENT "identifier"
 %token <uintval> 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;
 };
index 767ba2263aca0eea2fe0888ff0c2e4dd4207e767..8a6572ef2444d267ff565b58a402804b5c969b94 100644 (file)
@@ -124,11 +124,6 @@ INTEGER 0x[[:xdigit:]]+|0[0-7]+|[[:digit:]]+
 
 %{
        char *c;
-
-       if (yyextra > 0) {
-               yyextra = -yyextra;
-               return T_ENGLISH;
-       }
 %}
 
 "..."|[][;*(),] {