diff options
Diffstat (limited to 'examples/select_parser.py')
-rw-r--r-- | examples/select_parser.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/select_parser.py b/examples/select_parser.py index fd0e680..652a448 100644 --- a/examples/select_parser.py +++ b/examples/select_parser.py @@ -24,12 +24,10 @@ keywords = { } vars().update(keywords) -keyword = MatchFirst(keywords.values()) - -identifier = ~keyword + Word(alphas, alphanums + "_") +any_keyword = MatchFirst(keywords.values()) quoted_identifier = QuotedString('"', escQuote='""') -identifier = (~keyword + Word(alphas, alphanums + "_")).setParseAction( +identifier = (~any_keyword + Word(alphas, alphanums + "_")).setParseAction( pyparsing_common.downcaseTokens ) | quoted_identifier collation_name = identifier.copy() @@ -189,6 +187,7 @@ select_stmt << ( select_stmt.ignore(comment) + if __name__ == "__main__": tests = """\ select * from xyzzy where z > 100 |