From: Michael Wallner Date: Tue, 7 Mar 2017 11:50:02 +0000 (+0100) Subject: parser: NAME fallback ERROR,WARNING X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=1b6db76e3005344b33ab45b00e7e61386a33932a;p=m6w6%2Fext-psi parser: NAME fallback ERROR,WARNING --- diff --git a/src/cpp.h b/src/cpp.h index 81f27b3..1a8fc2c 100644 --- a/src/cpp.h +++ b/src/cpp.h @@ -29,7 +29,7 @@ #include "data.h" #ifndef PSI_CPP_DEBUG -# define PSI_CPP_DEBUG 1 +# define PSI_CPP_DEBUG 0 #endif struct psi_cpp_data { diff --git a/src/cpp_tokiter.c b/src/cpp_tokiter.c index 5753af7..7aa938e 100644 --- a/src/cpp_tokiter.c +++ b/src/cpp_tokiter.c @@ -371,9 +371,7 @@ static void psi_cpp_tokiter_expand_call_tokens(struct psi_cpp_data *cpp, } psi_cpp_tokiter_expand_tokens(cpp, tokens); - psi_cpp_tokiter_seek(cpp, psi_cpp_tokiter_index(cpp) + psi_plist_count(tokens)); psi_plist_free(tokens); - } static bool psi_cpp_tokiter_expand_call(struct psi_cpp_data *cpp, diff --git a/src/parser_proc.c b/src/parser_proc.c index 81d3ca2..295c60f 100644 --- a/src/parser_proc.c +++ b/src/parser_proc.c @@ -643,8 +643,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* CALLABLE => nothing */ 0, /* PRE_ASSERT => nothing */ 0, /* POST_ASSERT => nothing */ - 0, /* ERROR => nothing */ - 0, /* WARNING => nothing */ + 14, /* ERROR => NAME */ + 14, /* WARNING => NAME */ 14, /* TEMP => NAME */ 14, /* FREE => NAME */ 14, /* SET => NAME */ diff --git a/src/parser_proc.y b/src/parser_proc.y index bac0d38..29d354b 100644 --- a/src/parser_proc.y +++ b/src/parser_proc.y @@ -60,7 +60,7 @@ void psi_parser_proc_free(void **parser_proc) %left LSHIFT RSHIFT. %left PLUS MINUS. %left ASTERISK SLASH MODULO. -%fallback NAME TEMP FREE SET LET RETURN CALLOC CALLBACK ZVAL LIB STRING COUNT. +%fallback NAME TEMP FREE SET LET RETURN CALLOC CALLBACK ZVAL LIB STRING COUNT ERROR WARNING. %wildcard ANY. %type decl_enum {struct psi_decl_enum *} %destructor decl_enum {psi_decl_enum_free(&$$);} diff --git a/src/parser_proc_def.h b/src/parser_proc_def.h index ed1455a..85cb299 100644 --- a/src/parser_proc_def.h +++ b/src/parser_proc_def.h @@ -65,7 +65,7 @@ DEF(%left, LSHIFT RSHIFT.) DEF(%left, PLUS MINUS.) DEF(%left, ASTERISK SLASH MODULO.) -DEF(%fallback, NAME TEMP FREE SET LET RETURN CALLOC CALLBACK ZVAL LIB STRING COUNT.) +DEF(%fallback, NAME TEMP FREE SET LET RETURN CALLOC CALLBACK ZVAL LIB STRING COUNT ERROR WARNING.) DEF(%wildcard, ANY.) TOKEN_TYPE(decl_enum, struct psi_decl_enum *)