diff options
author | Tom Lane | 2009-07-14 20:24:10 +0000 |
---|---|---|
committer | Tom Lane | 2009-07-14 20:24:10 +0000 |
commit | 1aa58d3a8389fcf8899745049f128f6b8fec7bc9 (patch) | |
tree | 2e36e9cf65a517ce558fbfe694821da5bb28c131 /src/backend/parser/parser.c | |
parent | 0d4899e448df2b02434d6d423156408cde012707 (diff) |
Tweak the core scanner so that it can be used by plpgsql too.
Changes:
Pass in the keyword lookup array instead of having it be hardwired.
(This incidentally allows elimination of some duplicate coding in ecpg.)
Re-order the token declarations in gram.y so that non-keyword tokens have
numbers that won't change when keywords are added or removed.
Add ".." and ":=" to the set of tokens recognized by scan.l. (Since these
combinations are nowhere legal in core SQL, this does not change anything
except the precise wording of the error you get when you write this.)
Diffstat (limited to 'src/backend/parser/parser.c')
-rw-r--r-- | src/backend/parser/parser.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c index cb8ff8a3394..93632c88114 100644 --- a/src/backend/parser/parser.c +++ b/src/backend/parser/parser.c @@ -14,7 +14,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parser.c,v 1.80 2009/07/13 02:02:20 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parser.c,v 1.81 2009/07/14 20:24:10 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -39,7 +39,7 @@ raw_parser(const char *str) int yyresult; /* initialize the flex scanner */ - yyscanner = scanner_init(str, &yyextra); + yyscanner = scanner_init(str, &yyextra, ScanKeywords, NumScanKeywords); /* filtered_base_yylex() only needs this much initialization */ yyextra.have_lookahead = false; @@ -79,7 +79,7 @@ pg_parse_string_token(const char *token) YYSTYPE yylval; YYLTYPE yylloc; - yyscanner = scanner_init(token, &yyextra); + yyscanner = scanner_init(token, &yyextra, ScanKeywords, NumScanKeywords); ctoken = base_yylex(&yylval, &yylloc, yyscanner); |