]> git.draconx.ca Git - cdecl99.git/blobdiff - src/scan.l
libcdecl: Move specifier type determination into scanner.
[cdecl99.git] / src / scan.l
index 67183815da48e97642536c72e7dd131e050bf744..90f5ad9de3b88af33fc145f76181a4c9e32ef653 100644 (file)
@@ -169,8 +169,11 @@ INTEGER 0x[[:xdigit:]]+|0[0-7]+|[[:digit:]]+
 }
 
 {IDENT} {
-       int ret = cdecl__to_keyword(yytext, yyleng, yyextra);
-       if (ret == T_IDENT) {
+       unsigned x = cdecl__to_keyword(yytext, yyleng, yyextra);
+       int tok;
+
+       yylval->spectype = UNPACK_SPEC(x & 0xff);
+       if ((tok = (x >> 8)) == T_IDENT) {
                /*
                 * Our IDENT pattern includes hyphens so we can match
                 * "variable-length" as a keyword.  In all other cases a
@@ -189,7 +192,7 @@ INTEGER 0x[[:xdigit:]]+|0[0-7]+|[[:digit:]]+
 #endif
                dup_token();
        }
-       return ret;
+       return UNPACK_TOKEN(tok);
 }
 
 [[:space:]]+