X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/3a3760ad26782403f6686183be3faa8b22cf849b..8ef7bb974c538e4802688d45296ee988a6648e02:/src/scan.l diff --git a/src/scan.l b/src/scan.l index 6718381..90f5ad9 100644 --- a/src/scan.l +++ b/src/scan.l @@ -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:]]+