diff options
author | Georg Brandl <georg@python.org> | 2014-09-19 22:15:24 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-09-19 22:15:24 +0200 |
commit | c45439c1ef32348ed9476c441d81adbb84e71ec4 (patch) | |
tree | 0c19e4002fc63614266000fe917553c0a94d4faf /pygments/lexers/_postgres_builtins.py | |
parent | 6688456dd0d2e4e877eaf17fa604df3a9aca689a (diff) | |
download | pygments-c45439c1ef32348ed9476c441d81adbb84e71ec4.tar.gz |
Make all keyword lists in special modules into tuples.
Tuples of strings are stored as prebuild constants in the .pyc file
instead of having to build a list element by element at runtime.
Diffstat (limited to 'pygments/lexers/_postgres_builtins.py')
-rw-r--r-- | pygments/lexers/_postgres_builtins.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/pygments/lexers/_postgres_builtins.py b/pygments/lexers/_postgres_builtins.py index 11dc6dec..a11dd6d3 100644 --- a/pygments/lexers/_postgres_builtins.py +++ b/pygments/lexers/_postgres_builtins.py @@ -136,7 +136,7 @@ def update_consts(filename, constname, content): # Autogenerated: please edit them if you like wasting your time. -KEYWORDS = [ +KEYWORDS = ( 'ABORT', 'ABSOLUTE', 'ACCESS', 'ACTION', 'ADD', 'ADMIN', 'AFTER', 'AGGREGATE', 'ALL', 'ALSO', 'ALTER', 'ALWAYS', 'ANALYSE', 'ANALYZE', 'AND', 'ANY', 'ARRAY', 'AS', 'ASC', 'ASSERTION', 'ASSIGNMENT', @@ -199,9 +199,9 @@ KEYWORDS = [ 'XML', 'XMLATTRIBUTES', 'XMLCONCAT', 'XMLELEMENT', 'XMLEXISTS', 'XMLFOREST', 'XMLPARSE', 'XMLPI', 'XMLROOT', 'XMLSERIALIZE', 'YEAR', 'YES', 'ZONE', - ] +) -DATATYPES = [ +DATATYPES = ( 'bigint', 'bigserial', 'bit', 'bit varying', 'bool', 'boolean', 'box', 'bytea', 'char', 'character', 'character varying', 'cidr', 'circle', 'date', 'decimal', 'double precision', 'float4', 'float8', 'inet', @@ -211,23 +211,22 @@ DATATYPES = [ 'smallserial', 'text', 'time', 'timestamp', 'timestamptz', 'timetz', 'tsquery', 'tsvector', 'txid_snapshot', 'uuid', 'varbit', 'varchar', 'with time zone', 'without time zone', 'xml', - ] +) -PSEUDO_TYPES = [ +PSEUDO_TYPES = ( 'any', 'anyelement', 'anyarray', 'anynonarray', 'anyenum', 'anyrange', 'cstring', 'internal', 'language_handler', 'fdw_handler', 'record', 'trigger', 'void', 'opaque', - ] +) # Remove 'trigger' from types -PSEUDO_TYPES = sorted(set(PSEUDO_TYPES) - set(map(str.lower, KEYWORDS))) +PSEUDO_TYPES = tuple(sorted(set(PSEUDO_TYPES) - set(map(str.lower, KEYWORDS)))) -PLPGSQL_KEYWORDS = [ +PLPGSQL_KEYWORDS = ( 'ALIAS', 'CONSTANT', 'DIAGNOSTICS', 'ELSIF', 'EXCEPTION', 'EXIT', 'FOREACH', 'GET', 'LOOP', 'NOTICE', 'OPEN', 'PERFORM', 'QUERY', 'RAISE', 'RETURN', 'REVERSE', 'SQLSTATE', 'WHILE', - ] +) if __name__ == '__main__': update_myself() - |