HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/pygments/lexers/__pycache__/sql.cpython-310.pyc
o

;j���@sNdZddlZddlZddlmZmZmZmZmZddl	m
Z
ddl	mZddl	mZddl	m
Z
ddl	mZdd	l	mZmZdd
lmZmZmZmZmZmZmZmZmZmZmZgd�Ze�d�Ze�d
�Z e�dej!�Z"e�dej!�Z#e�d�Z$e�d�Z%e�dej!�Z&e�dej!�Z'e�d�Z(e
j)e
j*e
j+Z,dd�Z-Gdd�d�Z.Gdd�de.e�Z/Gdd�de.e�Z0Gdd�de.e�Z1e�d�Z2e�d �Z3e�d!�Z4e�d"�Z3e�d#�Z5e�d$�Z6Gd%d&�d&�Z7Gd'd(�d(e�Z8Gd)d*�d*e�Z9Gd+d,�d,e�Z:Gd-d.�d.e�Z;Gd/d0�d0e�Z<Gd1d2�d2e�Z=Gd3d4�d4e�Z>Gd5d6�d6e�Z?dS)7a�
    pygments.lexers.sql
    ~~~~~~~~~~~~~~~~~~~

    Lexers for various SQL dialects and related interactive sessions.

    Postgres specific lexers:

    `PostgresLexer`
        A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL
        lexer are:

        - keywords and data types list parsed from the PG docs (run the
          `_postgres_builtins` module to update them);
        - Content of $-strings parsed using a specific lexer, e.g. the content
          of a PL/Python function is parsed using the Python lexer;
        - parse PG specific constructs: E-strings, $-strings, U&-strings,
          different operators and punctuation.

    `PlPgsqlLexer`
        A lexer for the PL/pgSQL language. Adds a few specific construct on
        top of the PG SQL lexer (such as <<label>>).

    `PostgresConsoleLexer`
        A lexer to highlight an interactive psql session:

        - identifies the prompt and does its best to detect the end of command
          in multiline statement where not all the lines are prefixed by a
          prompt, telling them apart from the output;
        - highlights errors in the output and notification levels;
        - handles psql backslash commands.

    `PostgresExplainLexer`
        A lexer to highlight Postgres execution plan.

    The ``tests/examplefiles`` contains a few test files with data to be
    parsed by these lexers.

    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�Lexer�
RegexLexer�
do_insertions�bygroups�words)�_googlesql_builtins)�_mysql_builtins)�_postgres_builtins)�
_sql_builtins)�_tsql_builtins)�get_lexer_by_name�
ClassNotFound)�Punctuation�
Whitespace�Text�Comment�Operator�Keyword�Name�String�Number�Generic�Literal)
�GoogleSqlLexer�
PostgresLexer�PlPgsqlLexer�PostgresConsoleLexer�PostgresExplainLexer�SqlLexer�TransactSqlLexer�
MySqlLexer�SqliteConsoleLexer�RqlLexerz.*?
z^(?:sqlite|   ...)>(?= )z\s+LANGUAGE\s+'?(\w+)'?z\bDO\bz\[[a-zA-Z_]\w*\]z`[a-zA-Z_]\w*`z\bgo\bz
\bdeclare\s+@z@[a-zA-Z_]\w*\bccs��d}t�|j|��|��d��}|dur |�|�d��}n>tt�|jtd|�	�d�|�	����}|rB|�|d�d��}ntt
�|jtd|�	�d�|�	����}|r^|�d�}|�	d�t|�d�fV|�	d�tj|�d�fV|�	d	�t|�d	�fV|r�|�
|�d
��EdHn|�	d
�t|�d
�fV|�	d�t|�d�fV|�	d�tj|�d�fV|�	d
�t|�d
�fVdS)z�Parse the content of a $-string using a lexer

    The lexer is chosen looking for a nearby LANGUAGE or assumed as
    plpgsql if inside a DO statement and no LANGUAGE has been found.
    N�d�r�����plpgsql������)�language_re�match�text�end�
_get_lexer�group�list�finditer�max�start�do_rerZ	Delimiter�get_tokens_unprocessed)�lexerr/�lx�m�r=�G/opt/saltstack/salt/lib/python3.10/site-packages/pygments/lexers/sql.py�language_callbackRs0� ��
r?cs(eZdZdZ�fdd�Zdd�Z�ZS)�PostgresBasea�Base class for Postgres-related lexers.

    This is implemented as a mixin to avoid the Lexer metaclass kicking in.
    this way the different lexer don't have a common Lexer ancestor. If they
    had, _tokens could be created on this ancestor and not updated for the
    other classes, resulting e.g. in PL/pgSQL parsed as SQL. This shortcoming
    seem to suggest that regexp lexers are not really subclassable.
    c's&�||_t�j|g|�R�EdHdS�N)r0�superr9)�selfr0�args��	__class__r=r>r9s�z#PostgresBase.get_tokens_unprocessedc	Cs�|��dkrtdi|j��S|g}|�d�r|�|dd��|�d�r-|�|dd��|�d�r@|�d�r@|�|dd��|D]}zt|fi|j��WStyYYqBwdS)N�sql�
postgresql�plr(�ur%)rH)�lowerr�options�
startswith�append�endswithr
)rC�langZtriesr;r=r=r>r2�s 

�zPostgresBase._get_lexer)�__name__�
__module__�__qualname__�__doc__r9r2�
__classcell__r=r=rEr>r@vsr@c@sHeZdZdZdZddgZdgZdZdZe	j
Zdefd	e
jfd
e
jdfdd
�dd�ejejD��dejfeejdd�efdefdefdejfdejfdejfdeej ej�dfdeej ej�dfde!fdefdejfde"fgd
e
jdfd e
jd!fd"e
jfd#e
jfgd$ejfd%ejfd&ejd!fgd'ejfd(ejfd)ejd!fgd*�Z#d+S),rz2
    Lexer for the PostgreSQL dialect of SQL.
    zPostgreSQL SQL dialectrHZpostgresztext/x-postgresql�https://www.postgresql.org�1.5�\s+�--.*\n?�/\*�multiline-comments�(�|ccs�|]	}|�dd�VqdS)� rXN)�replace)�.0�sr=r=r>�	<genexpr>�s��zPostgresLexer.<genexpr>z)\b�\b��suffixz[+*/<>=~!@#%^&|`?-]+z::�\$\d+z&([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?�[0-9]+z((?:E|U&)?)(')�stringz((?:U&)?)(")�quoted-identz$(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)z	[a-z_]\w*�:(['"]?)[a-z]\w*\b\1z[;:()\[\]{},.]�\*/�#pop�[^/*]+�[/*]�[^']+�''�'�[^"]+�""�")�rootr[rhriN)$rQrRrSrT�name�aliases�	mimetypes�url�
version_added�re�
IGNORECASE�flagsrr�Single�	Multiline�joinr	�	DATATYPESZPSEUDO_TYPESr�Builtinr�KEYWORDSrr�Variabler�Float�IntegerrrZAffixr?r�tokensr=r=r=r>r�s^
�����

�
�
�
�rc@s�eZdZdZdZdgZdgZdZdZe	j
Zdd�ej
��D�Z
ee
d	�D]\ZZed
ekrBeejejdd�efe
d	e<[nq%Jd��dejfdefdejfdejfge
d	dd
�<dS)rz7
    Handle the extra syntax in Pl/pgSQL language.
    zPL/pgSQLr'ztext/x-plpgsqlz4https://www.postgresql.org/docs/current/plpgsql.htmlrWcC�i|]\}}||dd��qSrAr=�r`rv�stater=r=r>�
<dictcomp>��zPlPgsqlLexer.<dictcomp>rur$rcrdrzSQL keywords not foundz\%[a-z]\w*\bz:=z\<\<[a-z]\w*\>\>z\#[a-z]\w*\bN)rQrRrSrTrvrwrxryrzr{r|r}rr��items�	enumerate�i�patternrrr	r�ZPLPGSQL_KEYWORDSrr�r�Label�Pseudor=r=r=r>r�s6�����rc@s�eZdZdZdZgZejZdd�e	j
��D�Z
e
d�de
jdf�dedfd	efde
jfd
ejfdejfdejfd
ejfge
d<dS)�PsqlRegexLexerz�
    Extend the PostgresLexer adding support specific for psql commands.

    This is not a complete psql lexer yet as it lacks prompt support
    and output rendering.
    z'PostgreSQL console - regexp based lexercCr�rAr=r�r=r=r>r�r�zPsqlRegexLexer.<dictcomp>ruz\\[^\s]+zpsql-commandz\nrXrj�'(''|[^'])*'z	`([^`])*`z[^\s]+N)rQrRrSrTrvrwr{r|r}rr�r�rNrr�rrrr�rr~ZBacktick�Symbolr=r=r=r>r��s"
��r�z^(\S.*?)??[=\-\(\$\'\"][#>]z\s*\\z
;\s*(--.*?)?$z(\s*)(\\.+?)(\s+)$z(ERROR|FATAL):zS((?:DEBUG|INFO|NOTICE|WARNING|ERROR|FATAL|HINT|DETAIL|CONTEXT|LINE [0-9]+):)(.*?\n)c@s4eZdZdZdd�Zdd�Zdd�Zdd	�ZeZd
S)�	lookaheadz0Wrap an iterator and allow pushing back an item.cCst|�|_d|_dSrA)�iter�	_nextitem)rC�xr=r=r>�__init__s

zlookahead.__init__cCs|SrAr=)rCr=r=r>�__iter__"�zlookahead.__iter__cCs
||_|SrA)r�)rCr�r=r=r>�send%szlookahead.sendcCs$|jdur
|j}d|_|St|j�SrA)r��nextr�)rCZnir=r=r>�__next__)s


zlookahead.__next__N)	rQrRrSrTr�r�r�r�r�r=r=r=r>r�sr�c@s6eZdZdZdZgd�ZdgZdZdZdZ	dd	�Z
d
S)rz"
    Lexer for psql sessions.
    zPostgreSQL console (psql))Zpsqlzpostgresql-consolezpostgres-consoleztext/x-postgresql-psqlrVrWzpsql/psql_session.txtccs��td	i|j��}tt�|��}	d}g}|D]Q}|�d�r2|s2td
i|j��}|�|�EdHn7t�	|�}|durX|�
t|�dtj
|��fgf�||t|���d�7}n||7}t�	|�sft�|�rhnqt||�|��EdHtj}	|D]N}t�	|�}|dur�|�|�n?t�	|�}
|
dur�|
�d��d�s�|
�d��d�r�tj}	|
�d�tj|
�d�fV|
�d�|	|
�d�fVqyd|	|fVqydSq)Nr$��$�consoler�ERROR�FATALr(r=)r�)r�rLr��line_re�findallrMrr9�	re_promptr/rN�lenr�Promptr3�re_psql_command�re_end_command�searchr�Outputr��
re_message�Errorr7ZStrong)rC�datarG�lines�curcode�
insertions�liner:ZmpromptZ	out_tokenZmmsgr=r=r>r9>sV�

�
��
�


��z+PostgresConsoleLexer.get_tokens_unprocessedN)rQrRrSrTrvrwrxryrz�_exampler9r=r=r=r>r2src@s�eZdZdZdZdgZdgZdgZdZdZ	gde
f�d	ef�d
ee
je
�df�dee
jee
�df�ed
dd�ejf�deeje�f�dejf�deeje
�df�deeje
e�df�deee
e�df�eddd�ejdf�dejdf�deeeeje�df�eddd�ejf�eddd�e
jf�dee
je
e�f�eejdd�ef�d ejf�d!ejf�d"ejf�d#ejf�d$eeee
j�f�d%e
df�d&ejf�d'ejf�d(ejf�d)e
jf�d*ejf�d+eeje
e�d,f�d-eeje
�f�d.ejf�d/eejee
je
e�f�d0e
d1fd2e
d3fd4e
jfd5efgd6ee
je
�dfd7ee
jee
�dfd0e
d8fd9e
fd:e
jfd;e
jfd<e
jfd=e
dfd>e
dfd?e
jfd@e
jfdAe
jfdBe
jfdCe
jfdDefdEe
fdFe
fd2e
d3fgdGee
e
je
�d3fdHe
jd3fgdIe
fdDefdJe
jfdKejfdLejfd2e
d3fgdMeeje
j�fdNejdfdOejdfgdPee
j eeee�fdQe
fgd0e
fdRe
jfd2e
d3fgdSe
fdTej!fdUe
jfdLejfdDefgdV�	Z"dWS)Xrz*
    Handle PostgreSQL EXPLAIN output
    zPostgreSQL EXPLAIN dialectzpostgres-explainz	*.explainztext/x-postgresql-explainz:https://www.postgresql.org/docs/current/using-explain.htmlz2.15z!(:|\(|\)|ms|kB|->|\.\.|\,|\/|=|%)z(\s+)z
(cost)(=?)�instrumentationz(actual)( )(=?))�actualzMemory Usagez
Disk UsageZMemoryZBucketsZBatchesZ
originally�rowZrowsZHitsZMissesZ	EvictionsZ	OverflowszPlanned PartitionsZ	EstimatesZcapacityz
distinct keysZlookupszhit percentzIndex SearchesZStoragezDisk Maximum Storagercrdz.(hit|read|dirtied|written|write|time|calls)(=)z(shared|temp|local)z(Sort Method)(: )�sortz1(Sort Key|Group Key|Presorted Key|Hash Key)(:)( )�object_namez(Cache Key|Cache Mode)(:)( ))�Join FilterzSubplans Removed�Filterz
Merge Condz	Hash Condz
Index CondzRecheck CondzHeap BlockszTID Condz
Run ConditionzOrder Byz
Function CallzTable Function CallzInner UniquezParams EvaluatedzSingle CopyZSamplingzOne-Time Filterr�Z	Relationsz
Remote SQLZDisabled�	predicatez	Conflict �conflictz(InitPlan|SubPlan)( )(\d+)( )�	init_plan)zSort Methodr�z
Planning timez
Planning TimezExecution timezExecution TimezWorkers PlannedzWorkers LaunchedZBuffersZPlanningZWorkerzQuery IdentifierZTimezFull-sort GroupszPre-sorted Groups)zRows Removed by Join FilterzRows Removed by FilterzRows Removed by Index RecheckzHeap Fetchesznever executedz(I/O Timings)(:)( )z"((Right|Left|Full|Semi|Anti) Join)z%(Parallel |Async |Finalize |Partial )ZBackwardz(Intersect|Except|Hash)z(CTE)( )(\w*)?z
(on|using)r�z
-?\d+\.\d+z(-?\d+)z(true|false)z\s*QUERY PLAN\s*\n\s*-+z(Settings)(:)( )�settingz!(JIT|Functions|Options|Timing)(:)zG(Inlining|Optimization|Expressions|Deforming|Generation|Emission|Total)z(Trigger)( )(\S*)(:)( )z\(z#pushz\)rlz(never executed)z[^)(]+z(\(cost)(=?)z(\(actual)( )(=?)�
expressionz(on)z&\w+(\.\w+)*( USING \S+| \w+ USING \S+)z\"?\w+\"?(?:\.\"?\w+\"?)?z\'\S*\'z,\n�,z"\*SELECT\*( \d+)?"(.\w+)?z"\*VALUES\*(_\d+)?"(.\w+)?z"ANY_subquery"rfz::\w+z +rtz
\[\.\.\.\]z(\()([^\n]*)(\))z[^\n]*z=|\.\.z(rows|width|time|loops)z\d+\.\d+z(\d+)z(Resolution: )(\w+)z(Arbiter \w+:)z
(Filter: )z ([a-z_]*?)(\s*)(=)(\s*)(\'.*?\')z\, zreturns \$\d+(,\$\d+)?z:|kBz.(quicksort|top-N|heapsort|Average|Memory|Peak)z(external|merge|Disk|sort))	rur�r�r�r�r�r�r�r�N)#rQrRrSrTrvrw�	filenamesrxryrzrrrr�Classrrr~rrr��Preprocrr��	Exceptionr	ZEXPLAIN_KEYWORDS�Typer�rr��ConstantZ	AttributeZPrepocr�r=r=r=r>r{s*����
������������
&�)��-���5���9�;�>�?�@�A�C�G�K�M�N�Q�S�U�X�Y�\��c��#
��	

�����
�rc@s�eZdZdZdZdgZdgZdgZdZdZ	e
jZde
fd	ejfd
ejdfeejdd
�efeejdd
�ejfdefdejfdejfdejfdefdefgd
ejdfdejdfdejfdejfgd�Zdd�ZdS)rz
    Lexer for Structured Query Language. Currently, this lexer does
    not recognize any special syntax except ANSI SQL.
    ZSQLrG�*.sqlz
text/x-sqlz!https://en.wikipedia.org/wiki/SQLr�rXrYrZr[rcrdz[+*/<>=~!@#%^&|`?-]rgr��"(""|[^"])*"z[a-z_][\w$]*�[;:()\[\],.]rkrlrmrn�rur[cCsdSrAr=)rCr0r=r=r>�analyse_text\r�zSqlLexer.analyse_textN) rQrRrSrTrvrwr�rxryrzr{r|r}rrr~rrr
r�rr�rr�rrr�rr�rr�r�r=r=r=r>r7s8
�

��rc@s`eZdZdZdZddgZdgZdgZdZdZ	e
jZd	e
fd
ejfdejdfeej�efeejd
d�ejfeejd
d�ejfeejd
d�ejfdeee
ej�feejd
d�efdeeee�fde j!fde j"fde j"fde j"fde j#fde$jfde$j%fde&fdej'fdej(fdeeje&�fdefdej(j)fgdejdfdejdfd ejfd!ejfgd"�Z*d#d$�Z+d%S)&rz�
    Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to
    SQL.

    The list of keywords includes ODBC and keywords reserved for future use.
    zTransact-SQLZtsqlzt-sqlr�ztext/x-tsqlzhttps://www.tsql.infor�rXz--.*[$|\n]?rZr[rcrdz(goto)(\s+)(\w+\b)z(\[)([^]]+)(\])�0x[0-9a-f]+�[0-9]+\.[0-9]*(e[+-]?[0-9]+)?z\.[0-9]+(e[+-]?[0-9]+)?�[0-9]+e[+-]?[0-9]+rgr�r�z[;(),.]z@@\w+z@\w+z(\w+)(:)z#?#?\w+�\?rkrlrmrnr�cCs�d}t�|�rd}|Stt�|��}tt�|��}||}|dkr,|d|kr,|d7}n||kr5|d7}n|dkr=|d7}t�|�durH|d7}t�|�durS|d7}|S)Nrg�?r$r(��?皙�����?皙�����?)�tsql_declare_rer�r��name_between_backtick_rer��name_between_bracket_re�tsql_variable_re�
tsql_go_re�r0ZratingZname_between_backtick_countZname_between_bracket_countZdialect_name_countr=r=r>r��s.
���

zTransactSqlLexer.analyse_textN),rQrRrSrTrvrwr�rxryrzr{r|r}rrr~rrrZ	OPERATORSrZOPERATOR_WORDSZWordZTYPESrr�Z	FUNCTIONS�Functionrrr�r�r�Hexr�r�rr�rr�r�ZMagicr�r�r=r=r=r>r`sP

�
 
��(rc
@s�eZdZdZdZdgZdgZdZdZe	j
Zgdef�de
jf�d	e
jd
f�de
jdf�d
ejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejdf�dejdf�dejf�dejf�dejdf�d ejd!f�d"ejd#f�d$ejf�d%ef�d&ef�d'eeee�f�ee j!d(d(d)�ej"f�ee j#d(d(d)�ej$f�ee j%d(d(d)�ef�ee j&d(d*d)�eej'ee(�f�d+ef�d,ej)d-f�d.e(f�d/e
jfd0e
jd1fee j*d(d2�e
j+fd3e
jfd4e
jfgd5e
jfd0e
jd1fd4e
jfgd6ejfd7ej,fd8ej,fdejd1fgd9ejfd:ej,fd8ej,fdejd1fgd;ejfd7ejfdejd1fgd<ejfd:ejfdejd1fgd=ejfd>ejfd,ejd1fgd=ej)fd>ej)j,fd,ej)d1fgd?�	Z-d@dA�Z.dBS)Cr a5The Oracle MySQL lexer.

    This lexer does not attempt to maintain strict compatibility with
    MariaDB syntax or keywords. Although MySQL and MariaDB's common code
    history suggests there may be significant overlap between the two,
    compatibility between the two is not a target for this lexer.
    ZMySQLZmysqlztext/x-mysqlzhttps://www.mysql.comr�rX�
(?:#|--\s+).*z/\*\+�optimizer-hintsrZ�multiline-comment�x'([0-9a-f]{2})+'r��b'[01]+'�0b[01]+r��[0-9]*\.[0-9]+(e[+-]?[0-9]+)?r��"[0-9]+(?=[^0-9a-z$_\u0080-\uffff])�I\{\s*d\s*(?P<quote>['\"])\s*\d{2}(\d{2})?.?\d{2}.?\d{2}\s*(?P=quote)\s*\}�Z\{\s*t\s*(?P<quote>['\"])\s*(?:\d+\s+)?\d{1,2}.?\d{1,2}.?\d{1,2}(\.\d*)?\s*(?P=quote)\s*\}�p\{\s*ts\s*(?P<quote>['\"])\s*\d{2}(?:\d{2})?.?\d{2}.?\d{2}\s+\d{1,2}.?\d{1,2}.?\d{1,2}(\.\d*)?\s*(?P=quote)\s*\}rq�single-quoted-stringrt�double-quoted-string�9@@(?:global\.|persist\.|persist_only\.|session\.)?[a-z_]+�
@[a-z0-9_$.]+�@'�single-quoted-variable�@"�double-quoted-variable�@`�backtick-quoted-variabler�z[!%&*+/:<=>^|~-]+�\b(set)(?!\s*\()�\b(character)(\s+)(set)\brc��prefixre�\b(\s*)(\()�[0-9a-z$_€-￿]+�`�schema-object-name�[(),.;]z[^*a-z]+rkrlrdz[a-z]+�\*�[^*]+�[^'\\]+rp�\\[0'"bnrtZ\\%_]�[^"\\]+rsrorr�[^`]+�``)	rur�r�r�r�r�r�r�r�cCspd}tt�|��}tt�|��}||}|dkr$|d|kr$|d7}|S||kr.|d7}|S|dkr6|d7}|S)Nrr$r(r�r�r�)r�r�r�r�r�r=r=r>r�`s$����zMySqlLexer.analyse_textN)/rQrRrSrTrvrwrxryrzr{r|r}rrr~�Specialrrr��Binr�r�r�Dater�Doublerr�rrrrrZMYSQL_CONSTANTSr�ZMYSQL_DATATYPESr�ZMYSQL_KEYWORDSZMYSQL_FUNCTIONSr�r�QuotedZMYSQL_OPTIMIZER_HINTSr��Escaper�r�r=r=r=r>r �s��
�
�	�
�
���������� ��
)�
*�-�.�
/�
0�
1�2�5�8�9�<��>��@��B��K�
L�O�V
��

�

�
�
�
�
�

���r c@s�eZdZdZdZddgZddgZddgZd	Zd
Z	e
jZgde
f�dejf�d
ejdf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejf�dejdf�dejdf�dejf�dejf�d ejd!f�d"ejd#f�d$ejd%f�d&ejf�d'ef�d(eee
e�f�eej d)d)d*�ej!f�eej"d)d)d*�ej#f�eej$d)d)d*�ef�eej%d)d+d*�eej&e
e'�f�eej(d)d)d*�e)f�d,ef�d-ej*d.f�d/e'f�d0ejfd1ejd2fd3ejfgd4ejfd5ej+fd6ej+fdejd2fgd7ejfd8ej+fd6ej+fdejd2fgd9ejfd5ejfdejd2fgd:ejfd8ejfdejd2fgd;ejfd<ejfd-ejd2fgd;ej*fd<ej*j+fd-ej*d2fgd=�Z,d>d?�Z-d@S)Arz�
    GoogleSQL is Google's standard SQL dialect, formerly known as ZetaSQL.

    The list of keywords includes reserved words for future use.
    Z	GoogleSQLZ	googlesqlZzetasqlz*.googlesqlz*.googlesql.sqlztext/x-google-sqlztext/x-google-sql-auxz+https://cloud.google.com/bigquery/googlesqlz2.19rXr�rZr�r�r�r�r�r�r�r�r�r�r�r�rqr�rtr�r�r�r�r�r�r�r�r�r�r�r�rcr�r�r�r�r�r�r�rkrlr�r�rpr�r�rsrorrrr)rur�r�r�r�r�r�r�cCs(t�|���}dtdd�|��D��S)Ng����MbP?css �|]\}}|tvr|VqdSrA)�googlesql_identifiers)r`�t�countr=r=r>rbs�
��z.GoogleSqlLexer.analyse_text.<locals>.<genexpr>)�collections�Counter�split�sumr�)r0r�r=r=r>r�
szGoogleSqlLexer.analyse_textN).rQrRrSrTrvrwr�rxryrzr{r|r}rrr~rrr�rr�r�rrrrrr�rrrrZ	constantsr��typesr��keywords�
functionnamesr�rZ	operatorsrrrr�r�r=r=r=r>rss���
��	��
�����������
(�
)�,�-�
.�
/�
0�1�4�5�8�9�:�;��=�E�
F�I�P
�

�
�
�
�
�

���rc@s:eZdZdZdZdgZdgZdgZdZdZ	dZ
d	d
�ZdS)r!z3
    Lexer for example sessions using sqlite3.
    Z
sqlite3conZsqlite3z*.sqlite3-consoleztext/x-sqlite3-consolezhttps://www.sqlite.orgz0.11zsqlite3/sqlite3.sqlite3-consolec	cs�tdi|j��}d}g}t�|�D]`}|��}t�|�}|durI|�t|�dt	j
|dd�fgf�|�t|�dtdfgf�||dd�7}q|rZt||�
|��EdHd}g}|�d�ri|��t	j|fVq|��t	j|fVq|r�t||�
|��EdHdSdS)Nr�rr-r^�zSQL error: r=)rrLr�r5r3�sqlite_prompt_rer/rNr�rr�rrr9rMr7Z	Tracebackr�)rCr�rGr�r�r/r�Zprompt_matchr=r=r>r9 s:�

�

�
�
��z)SqliteConsoleLexer.get_tokens_unprocessedN)rQrRrSrTrvrwr�rxryrzr�r9r=r=r=r>r!sr!c@szeZdZdZdZdZdgZdgZdgZdZ	e
jZdd	e
fd
efdefdejfd
ejfdefdejfdejfdefg	iZdS)r"z,
    Lexer for Relation Query Language.
    ZRQLz"http://www.logilab.org/project/rqlZrqlz*.rqlz
text/x-rqlz2.0rurXz�(DELETE|SET|INSERT|UNION|DISTINCT|WITH|WHERE|BEING|OR|AND|NOT|GROUPBY|HAVING|ORDERBY|ASC|DESC|LIMIT|OFFSET|TODAY|NOW|TRUE|FALSE|NULL|EXISTS)\bz
[+*/<>=%-]z)(Any|is|instance_of|CWEType|CWRelation)\brgz[A-Z_]\w*\??r�r�r�N)rQrRrSrTrvryrwr�rxrzr{r|r}rrrrr�rr�rr~rr�r=r=r=r>r"=s.���r")@rTrr{Zpygments.lexerrrrrrZpygments.lexersrrr	r
rrr
Zpygments.tokenrrrrrrrrrrr�__all__�compiler�rr|r.r8r�r�r�r�r�rrrrr?r@rrr�r�r�r�Zre_errorr�r�rrrrr rr!r"r=r=r=r>�<module>sh*4




���$%9#




�I=)V>!*