X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fparser.re;h=d4a25d2a5592e901881d18a56022a59edda168b3;hp=81005f2c07acd238bcecd8fde42742ab6f83000b;hb=14c98cac21b8102d1d4c2a57744f6976ea3a0849;hpb=61918592ab618c073b9846783ce79fed9f26c5f7 diff --git a/src/parser.re b/src/parser.re index 81005f2..d4a25d2 100644 --- a/src/parser.re +++ b/src/parser.re @@ -141,6 +141,9 @@ void PSI_ParserFree(PSI_Parser **P) #define RETURN(t) do { \ P->num = t; \ + if (P->flags & PSI_PARSER_DEBUG) { \ + fprintf(stderr, "PSI> TOKEN: %d %.*s (EOF=%d)\n", P->num, (int) (P->cur-P->tok), P->tok, P->num == PSI_T_EOF); \ + } \ return t; \ } while(1) @@ -154,7 +157,7 @@ token_t PSI_ParserScan(PSI_Parser *P) re2c:define:YYCURSOR = P->cur; re2c:define:YYLIMIT = P->lim; re2c:define:YYMARKER = P->mrk; - re2c:define:YYFILL = "{ if (!PSI_ParserFill(P,@@)) RETURN(-1); }"; + re2c:define:YYFILL = "{ if (!PSI_ParserFill(P,@@)) RETURN(PSI_T_EOF); }"; re2c:yyfill:parameter = 0; B = [^a-zA-Z0-9_]; @@ -197,6 +200,7 @@ token_t PSI_ParserScan(PSI_Parser *P) 'UINT32_T' {RETURN(PSI_T_UINT32);} 'INT64_T' {RETURN(PSI_T_INT64);} 'UINT64_T' {RETURN(PSI_T_UINT64);} + 'UNSIGNED' {RETURN(PSI_T_UNSIGNED);} 'STRING' {RETURN(PSI_T_STRING);} 'ARRAY' {RETURN(PSI_T_ARRAY);} 'FUNCTION' {RETURN(PSI_T_FUNCTION);}