summaryrefslogtreecommitdiff
path: root/src/include/parser/keywords.h
diff options
context:
space:
mode:
authorTom Lane2009-07-14 20:24:10 +0000
committerTom Lane2009-07-14 20:24:10 +0000
commit1aa58d3a8389fcf8899745049f128f6b8fec7bc9 (patch)
tree2e36e9cf65a517ce558fbfe694821da5bb28c131 /src/include/parser/keywords.h
parent0d4899e448df2b02434d6d423156408cde012707 (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/include/parser/keywords.h')
-rw-r--r--src/include/parser/keywords.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/parser/keywords.h b/src/include/parser/keywords.h
index 203700122e3..2099e55664f 100644
--- a/src/include/parser/keywords.h
+++ b/src/include/parser/keywords.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/parser/keywords.h,v 1.26 2009/01/01 17:24:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/parser/keywords.h,v 1.27 2009/07/14 20:24:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,8 +29,10 @@ typedef struct ScanKeyword
} ScanKeyword;
extern const ScanKeyword ScanKeywords[];
-extern const ScanKeyword *LastScanKeyword;
+extern const int NumScanKeywords;
-extern const ScanKeyword *ScanKeywordLookup(const char *text);
+extern const ScanKeyword *ScanKeywordLookup(const char *text,
+ const ScanKeyword *keywords,
+ int num_keywords);
#endif /* KEYWORDS_H */