diff options
author | ptmcg <ptmcg@austin.rr.com> | 2019-11-18 23:10:58 -0600 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2019-11-18 23:10:58 -0600 |
commit | 3c6afc4657c3b2e1d5eb122e2d7bb602ba1ce821 (patch) | |
tree | 7aded921e023a6200d6319fcc24218842342d51c /examples/select_parser.py | |
parent | 0b398062710dc00b952636bcf7b7933f74f125da (diff) | |
download | pyparsing-git-3c6afc4657c3b2e1d5eb122e2d7bb602ba1ce821.tar.gz |
Include 2.4.x change notes to CHANGES; add select_parser to unit tests; minor changes to select_parser
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 |