aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py146
1 files changed, 73 insertions, 73 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py
index 93bc42059a..990b11d409 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py
@@ -4,7 +4,7 @@
Self-updating data files for PostgreSQL lexer.
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -35,7 +35,7 @@ KEYWORDS = (
'ASSIGNMENT',
'ASYMMETRIC',
'AT',
- 'ATTACH',
+ 'ATTACH',
'ATTRIBUTE',
'AUTHORIZATION',
'BACKWARD',
@@ -49,7 +49,7 @@ KEYWORDS = (
'BOTH',
'BY',
'CACHE',
- 'CALL',
+ 'CALL',
'CALLED',
'CASCADE',
'CASCADED',
@@ -69,14 +69,14 @@ KEYWORDS = (
'COLLATE',
'COLLATION',
'COLUMN',
- 'COLUMNS',
+ 'COLUMNS',
'COMMENT',
'COMMENTS',
'COMMIT',
'COMMITTED',
'CONCURRENTLY',
'CONFIGURATION',
- 'CONFLICT',
+ 'CONFLICT',
'CONNECTION',
'CONSTRAINT',
'CONSTRAINTS',
@@ -88,7 +88,7 @@ KEYWORDS = (
'CREATE',
'CROSS',
'CSV',
- 'CUBE',
+ 'CUBE',
'CURRENT',
'CURRENT_CATALOG',
'CURRENT_DATE',
@@ -114,9 +114,9 @@ KEYWORDS = (
'DELETE',
'DELIMITER',
'DELIMITERS',
- 'DEPENDS',
+ 'DEPENDS',
'DESC',
- 'DETACH',
+ 'DETACH',
'DICTIONARY',
'DISABLE',
'DISCARD',
@@ -142,7 +142,7 @@ KEYWORDS = (
'EXECUTE',
'EXISTS',
'EXPLAIN',
- 'EXPRESSION',
+ 'EXPRESSION',
'EXTENSION',
'EXTERNAL',
'EXTRACT',
@@ -162,14 +162,14 @@ KEYWORDS = (
'FULL',
'FUNCTION',
'FUNCTIONS',
- 'GENERATED',
+ 'GENERATED',
'GLOBAL',
'GRANT',
'GRANTED',
'GREATEST',
'GROUP',
- 'GROUPING',
- 'GROUPS',
+ 'GROUPING',
+ 'GROUPS',
'HANDLER',
'HAVING',
'HEADER',
@@ -181,9 +181,9 @@ KEYWORDS = (
'IMMEDIATE',
'IMMUTABLE',
'IMPLICIT',
- 'IMPORT',
+ 'IMPORT',
'IN',
- 'INCLUDE',
+ 'INCLUDE',
'INCLUDING',
'INCREMENT',
'INDEX',
@@ -228,13 +228,13 @@ KEYWORDS = (
'LOCALTIMESTAMP',
'LOCATION',
'LOCK',
- 'LOCKED',
- 'LOGGED',
+ 'LOCKED',
+ 'LOGGED',
'MAPPING',
'MATCH',
'MATERIALIZED',
'MAXVALUE',
- 'METHOD',
+ 'METHOD',
'MINUTE',
'MINVALUE',
'MODE',
@@ -245,16 +245,16 @@ KEYWORDS = (
'NATIONAL',
'NATURAL',
'NCHAR',
- 'NEW',
+ 'NEW',
'NEXT',
- 'NFC',
- 'NFD',
- 'NFKC',
- 'NFKD',
+ 'NFC',
+ 'NFD',
+ 'NFKC',
+ 'NFKD',
'NO',
'NONE',
- 'NORMALIZE',
- 'NORMALIZED',
+ 'NORMALIZE',
+ 'NORMALIZED',
'NOT',
'NOTHING',
'NOTIFY',
@@ -269,7 +269,7 @@ KEYWORDS = (
'OFF',
'OFFSET',
'OIDS',
- 'OLD',
+ 'OLD',
'ON',
'ONLY',
'OPERATOR',
@@ -278,16 +278,16 @@ KEYWORDS = (
'OR',
'ORDER',
'ORDINALITY',
- 'OTHERS',
+ 'OTHERS',
'OUT',
'OUTER',
'OVER',
'OVERLAPS',
'OVERLAY',
- 'OVERRIDING',
+ 'OVERRIDING',
'OWNED',
'OWNER',
- 'PARALLEL',
+ 'PARALLEL',
'PARSER',
'PARTIAL',
'PARTITION',
@@ -307,9 +307,9 @@ KEYWORDS = (
'PRIVILEGES',
'PROCEDURAL',
'PROCEDURE',
- 'PROCEDURES',
+ 'PROCEDURES',
'PROGRAM',
- 'PUBLICATION',
+ 'PUBLICATION',
'QUOTE',
'RANGE',
'READ',
@@ -319,7 +319,7 @@ KEYWORDS = (
'RECURSIVE',
'REF',
'REFERENCES',
- 'REFERENCING',
+ 'REFERENCING',
'REFRESH',
'REINDEX',
'RELATIVE',
@@ -337,15 +337,15 @@ KEYWORDS = (
'RIGHT',
'ROLE',
'ROLLBACK',
- 'ROLLUP',
- 'ROUTINE',
- 'ROUTINES',
+ 'ROLLUP',
+ 'ROUTINE',
+ 'ROUTINES',
'ROW',
'ROWS',
'RULE',
'SAVEPOINT',
'SCHEMA',
- 'SCHEMAS',
+ 'SCHEMAS',
'SCROLL',
'SEARCH',
'SECOND',
@@ -359,16 +359,16 @@ KEYWORDS = (
'SESSION_USER',
'SET',
'SETOF',
- 'SETS',
+ 'SETS',
'SHARE',
'SHOW',
'SIMILAR',
'SIMPLE',
- 'SKIP',
+ 'SKIP',
'SMALLINT',
'SNAPSHOT',
'SOME',
- 'SQL',
+ 'SQL',
'STABLE',
'STANDALONE',
'START',
@@ -377,31 +377,31 @@ KEYWORDS = (
'STDIN',
'STDOUT',
'STORAGE',
- 'STORED',
+ 'STORED',
'STRICT',
'STRIP',
- 'SUBSCRIPTION',
+ 'SUBSCRIPTION',
'SUBSTRING',
- 'SUPPORT',
+ 'SUPPORT',
'SYMMETRIC',
'SYSID',
'SYSTEM',
'TABLE',
'TABLES',
- 'TABLESAMPLE',
+ 'TABLESAMPLE',
'TABLESPACE',
'TEMP',
'TEMPLATE',
'TEMPORARY',
'TEXT',
'THEN',
- 'TIES',
+ 'TIES',
'TIME',
'TIMESTAMP',
'TO',
'TRAILING',
'TRANSACTION',
- 'TRANSFORM',
+ 'TRANSFORM',
'TREAT',
'TRIGGER',
'TRIM',
@@ -410,7 +410,7 @@ KEYWORDS = (
'TRUSTED',
'TYPE',
'TYPES',
- 'UESCAPE',
+ 'UESCAPE',
'UNBOUNDED',
'UNCOMMITTED',
'UNENCRYPTED',
@@ -453,12 +453,12 @@ KEYWORDS = (
'XMLELEMENT',
'XMLEXISTS',
'XMLFOREST',
- 'XMLNAMESPACES',
+ 'XMLNAMESPACES',
'XMLPARSE',
'XMLPI',
'XMLROOT',
'XMLSERIALIZE',
- 'XMLTABLE',
+ 'XMLTABLE',
'YEAR',
'YES',
'ZONE',
@@ -495,12 +495,12 @@ DATATYPES = (
'line',
'lseg',
'macaddr',
- 'macaddr8',
+ 'macaddr8',
'money',
'numeric',
'path',
'pg_lsn',
- 'pg_snapshot',
+ 'pg_snapshot',
'point',
'polygon',
'real',
@@ -528,27 +528,27 @@ DATATYPES = (
PSEUDO_TYPES = (
'any',
- 'anyarray',
- 'anycompatible',
- 'anycompatiblearray',
- 'anycompatiblenonarray',
- 'anycompatiblerange',
+ 'anyarray',
+ 'anycompatible',
+ 'anycompatiblearray',
+ 'anycompatiblenonarray',
+ 'anycompatiblerange',
'anyelement',
- 'anyenum',
+ 'anyenum',
'anynonarray',
'anyrange',
'cstring',
- 'event_trigger',
- 'fdw_handler',
- 'index_am_handler',
+ 'event_trigger',
+ 'fdw_handler',
+ 'index_am_handler',
'internal',
'language_handler',
- 'pg_ddl_command',
+ 'pg_ddl_command',
'record',
- 'table_am_handler',
+ 'table_am_handler',
'trigger',
- 'tsm_handler',
- 'unknown',
+ 'tsm_handler',
+ 'unknown',
'void',
)
@@ -573,26 +573,26 @@ if __name__ == '__main__': # pragma: no cover
# One man's constant is another man's variable.
SOURCE_URL = 'https://github.com/postgres/postgres/raw/master'
- KEYWORDS_URL = SOURCE_URL + '/src/include/parser/kwlist.h'
+ KEYWORDS_URL = SOURCE_URL + '/src/include/parser/kwlist.h'
DATATYPES_URL = SOURCE_URL + '/doc/src/sgml/datatype.sgml'
def update_myself():
- content = urlopen(DATATYPES_URL).read().decode('utf-8', errors='ignore')
- data_file = list(content.splitlines())
+ content = urlopen(DATATYPES_URL).read().decode('utf-8', errors='ignore')
+ data_file = list(content.splitlines())
datatypes = parse_datatypes(data_file)
pseudos = parse_pseudos(data_file)
- content = urlopen(KEYWORDS_URL).read().decode('utf-8', errors='ignore')
- keywords = parse_keywords(content)
-
+ content = urlopen(KEYWORDS_URL).read().decode('utf-8', errors='ignore')
+ keywords = parse_keywords(content)
+
update_consts(__file__, 'DATATYPES', datatypes)
update_consts(__file__, 'PSEUDO_TYPES', pseudos)
update_consts(__file__, 'KEYWORDS', keywords)
def parse_keywords(f):
kw = []
- for m in re.finditer(r'PG_KEYWORD\("(.+?)"', f):
- kw.append(m.group(1).upper())
+ for m in re.finditer(r'PG_KEYWORD\("(.+?)"', f):
+ kw.append(m.group(1).upper())
if not kw:
raise ValueError('no keyword found')
@@ -631,7 +631,7 @@ if __name__ == '__main__': # pragma: no cover
def parse_pseudos(f):
dt = []
re_start = re.compile(r'\s*<table id="datatype-pseudotypes-table">')
- re_entry = re.compile(r'\s*<entry><type>(.+?)</type></entry>')
+ re_entry = re.compile(r'\s*<entry><type>(.+?)</type></entry>')
re_end = re.compile(r'\s*</table>')
f = iter(f)
@@ -654,7 +654,7 @@ if __name__ == '__main__': # pragma: no cover
if not dt:
raise ValueError('pseudo datatypes not found')
- dt.sort()
+ dt.sort()
return dt
def update_consts(filename, constname, content):
@@ -671,7 +671,7 @@ if __name__ == '__main__': # pragma: no cover
new_block = format_lines(constname, content)
data = data[:m.start()] + new_block + data[m.end():]
- with open(filename, 'w', newline='\n') as f:
+ with open(filename, 'w', newline='\n') as f:
f.write(data)
update_myself()