diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-12-11 18:04:28 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-12-11 18:04:28 -0500 |
commit | 15b3722700ca043494804dfd1fe7556c50d4f9e9 (patch) | |
tree | 9e9535882d47c4a2255e4f09990183286c86d813 /src/interfaces/ecpg/preproc/parser.c | |
parent | 4262c5b1eecc63f12f86daa293428009eee54b5c (diff) | |
download | postgresql-15b3722700ca043494804dfd1fe7556c50d4f9e9.tar.gz postgresql-15b3722700ca043494804dfd1fe7556c50d4f9e9.zip |
Use "%option prefix" to set API names in ecpg's lexer.
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
Diffstat (limited to 'src/interfaces/ecpg/preproc/parser.c')
-rw-r--r-- | src/interfaces/ecpg/preproc/parser.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; |