From 15b3722700ca043494804dfd1fe7556c50d4f9e9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 11 Dec 2016 18:04:28 -0500 Subject: Use "%option prefix" to set API names in ecpg's lexer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Back-patch commit 92fb64983 into the pre-9.6 branches. Without this, ecpg fails to build with the latest version of flex. It's not unreasonable that people would want to compile our old branches with recent tools. Per report from Дилян Палаузов. Discussion: https://postgr.es/m/d845c1af-e18d-6651-178f-9f08cdf37e10@aegee.org --- src/interfaces/ecpg/preproc/parser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/interfaces/ecpg/preproc/parser.c') diff --git a/src/interfaces/ecpg/preproc/parser.c b/src/interfaces/ecpg/preproc/parser.c index 662a90a3f6b..75c559d26cf 100644 --- a/src/interfaces/ecpg/preproc/parser.c +++ b/src/interfaces/ecpg/preproc/parser.c @@ -60,7 +60,7 @@ filtered_base_yylex(void) cur_token = lookahead_token; base_yylval = lookahead_yylval; base_yylloc = lookahead_yylloc; - yytext = lookahead_yytext; + base_yytext = lookahead_yytext; *lookahead_end = lookahead_hold_char; have_lookahead = false; } @@ -93,13 +93,13 @@ filtered_base_yylex(void) * '\0' here, and will undo that when we call it again. We need to redo * it to fully revert the lookahead call for error reporting purposes. */ - lookahead_end = yytext + cur_token_length; + lookahead_end = base_yytext + cur_token_length; Assert(*lookahead_end == '\0'); /* Save and restore lexer output variables around the call */ cur_yylval = base_yylval; cur_yylloc = base_yylloc; - cur_yytext = yytext; + cur_yytext = base_yytext; /* Get next token, saving outputs into lookahead variables */ next_token = base_yylex(); @@ -107,11 +107,11 @@ filtered_base_yylex(void) lookahead_token = next_token; lookahead_yylval = base_yylval; lookahead_yylloc = base_yylloc; - lookahead_yytext = yytext; + lookahead_yytext = base_yytext; base_yylval = cur_yylval; base_yylloc = cur_yylloc; - yytext = cur_yytext; + base_yytext = cur_yytext; /* Now revert the un-truncation of the current token */ lookahead_hold_char = *lookahead_end; -- cgit v1.2.3