Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
sql.cpython-313.pyc346 linesDownload Raw Back to __pycache__
1�

2�j�����SrSSKrSSKrSSKJrJrJrJrJr SSK	J3r4 SSK	Jr SSK	Jr SSK	J
r
 SSK	Jr SS	K	JrJr SS5KJrJrJrJrJrJrJrJrJrJrJr /SQr\R<"S5r\R<"S
5r \R<"S\RB5r"\R<"S\RB5r#\R<"S5r$\R<"S5r%\R<"S\RB5r&\R<"S\RB5r'\R<"S5r(\6RR\7RT-\8RV-r,Sr-"SS5r."SS\.\5r/"SS\.\5r0"SS\.\5r1\R<"S5r2\R<"S5r3\R<"S 5r4\R<"S!5r3\R<"S"5r5\R<"S#5r6"S$S%5r7"S&S'\5r8"S(S)\5r9"S*S+\5r:"S,S-\5r;"S.S/\5r<"S0S1\5r="S2S3\5r>"S4S5\5r?g)6a{9pygments.lexers.sql10~~~~~~~~~~~~~~~~~~~11 12Lexers for various SQL dialects and related interactive sessions.13 14Postgres specific lexers:15 16`PostgresLexer`17    A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL18    lexer are:19 20    - keywords and data types list parsed from the PG docs (run the21      `_postgres_builtins` module to update them);22    - Content of $-strings parsed using a specific lexer, e.g. the content23      of a PL/Python function is parsed using the Python lexer;24    - parse PG specific constructs: E-strings, $-strings, U&-strings,25      different operators and punctuation.26 27`PlPgsqlLexer`28    A lexer for the PL/pgSQL language. Adds a few specific construct on29    top of the PG SQL lexer (such as <<label>>).30 31`PostgresConsoleLexer`32    A lexer to highlight an interactive psql session:33 34    - identifies the prompt and does its best to detect the end of command35      in multiline statement where not all the lines are prefixed by a36      prompt, telling them apart from the output;37    - highlights errors in the output and notification levels;38    - handles psql backslash commands.39 40`PostgresExplainLexer`41    A lexer to highlight Postgres execution plan.42 43The ``tests/examplefiles`` contains a few test files with data to be44parsed by these lexers.45 46:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.47:license: BSD, see LICENSE for details.48�N)�Lexer�49RegexLexer�
do_insertions�bygroups�words)�_googlesql_builtins)�_mysql_builtins)�_postgres_builtins)�
_sql_builtins)�_tsql_builtins)�get_lexer_by_name�
ClassNotFound)�Punctuation�50Whitespace�Text�Comment�Operator�Keyword�Name�String�Number�Generic�Literal)51�GoogleSqlLexer�
PostgresLexer�PlPgsqlLexer�PostgresConsoleLexer�PostgresExplainLexer�SqlLexer�TransactSqlLexer�52MySqlLexer�SqliteConsoleLexer�RqlLexerz.*?53z^(?: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*\bc54#�z# �Sn[RURUR5UR5S-5nUb!UR	URS55nO�[
[RUR[SUR5S-555UR555nU(a$UR	USRS55nOl[
[RUR[SUR5S-565UR555nU(aUR	S5nURS5[URS54v� URS5[RURS54v� URS	5[URS	54v� U(a)URURS5755Shv�N O)URS585[URS5954v� URS5[URS54v� URS5[RURS54v� URS
5[URS
54v� gN�7f)z�Parse the content of a $-string using a lexer60 61The lexer is chosen looking for a nearby LANGUAGE or assumed as62plpgsql if inside a DO statement and no LANGUAGE has been found.63N�d�r�������plpgsql������)�language_re�match�text�end�64_get_lexer�group�list�finditer�max�start�do_rer�	Delimiter�get_tokens_unprocessed)�lexerr1�lx�ms    �YD:\code\apps\devtools\python\user_packages\Python313\site-packages\pygments/lexers/sql.py�language_callbackrARs����65�B����%�*�*�U�Y�Y�[�����S��A�B�A��}�
�
�
�a�g�g�a�j�
)����%�%��J�J�s�1�e�k�k�m�C�/�0�����?�A�
B����!�!�!�B�%�+�+�a�.�1�B��U�^�^��66�67�3�q�%�+�+�-��"2�3�E�K�K�M�B�D�E�A���%�%�i�0���;�;�q�>�6�5�;�;�q�>�682�2��;�;�q�>�6�+�+�U�[�[��^�69<�<��;�;�q�>�6�5�;�;�q�>�702�2�	��,�,�U�[�[��^�<�<�<��{�{�1�~�v�u�{�{�1�~�6�6��;�;�q�>�6�5�;�;�q�>�712�2��;�;�q�>�6�+�+�U�[�[��^�72<�<��;�;�q�>�6�5�;�;�q�>�732�2�
	=�s�HJ;�J9�B5J;c�2^�\rSrSrSrU4SjrSrSrU=r$)�PostgresBase�va�Base class for Postgres-related lexers.74 75This is implemented as a mixin to avoid the Lexer metaclass kicking in.76this way the different lexer don't have a common Lexer ancestor. If they77had, _tokens could be created on this ancestor and not updated for the78other classes, resulting e.g. in PL/pgSQL parsed as SQL. This shortcoming79seem to suggest that regexp lexers are not really subclassable.80c'�P># �Xl[TU]"U/UQ76Shv�N gN7f�N)r2�superr<)�selfr2�args�	__class__s   �r@r<�#PostgresBase.get_tokens_unprocesseds#�����	��7�1�$�>��>�>�>�s�&�$�&c���UR5S:Xa[S0URD6$U/nURS5(aUR	USS5 URS5(aUR	USS5 URS5(a*URS5(aUR	USS5 UHn[U40URD6s $ g![a M,f=f)N�sql�plr*�ur')�81postgresql)�lowerr
�options�82startswith�append�endswithr)rH�lang�triesr>s    r@r4�PostgresBase._get_lexer�s����:�:�<�5� �$�B�T�\�\�B�B�����?�?�4� � ��L�L��a�b��"��=�=�����L�L��c�r��#��?�?�4� � �T�]�]�3�%7�%7��L�L��a���$��B�
�(��<�t�|�|�<�<����!�
��
�s�C"�"83C0�/C0)r2)	�__name__�84__module__�__qualname__�__firstlineno__�__doc__r<r4�__static_attributes__�
__classcell__)rJs@r@rCrCvs����?�85��rCc�F�\rSrSrSrSrSS/rS/rSrSr	\86RrS	\
4S87\R4S\R S4S
SR#S\R&\R(-55-S-\R,4\"\R0SS9\4S\4S\4S\R64S\R:4S\R<4S\"\ RB\ R5S4S\"\ RB\ R*5S4S\"4S\4S\R64S\#4/S\R S4S \R S!4S"\R 4S#\R 4/S$\ R4S%\ R4S&\ RS!4/S'\ R*4S(\ R*4S)\ R*S!4/S*.r$S+r%g,)-r�z*88Lexer for the PostgreSQL dialect of SQL.89zPostgreSQL SQL dialectrP�postgresztext/x-postgresql�https://www.postgresql.org�1.5�\s+�--.*\n?�/\*�multiline-comments�(�|c#�F# �UHnURSS5v� M g7f)� rfN)�replace)�.0�ss  r@�	<genexpr>�PostgresLexer.<genexpr>�s)���>�'=���Y�Y�s�F�3�3�'=�s�!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�[^/*]+�[/*]�[^']+�''�'�[^"]+�""�")�rootrirxry�N)&rYrZr[r\r]�name�aliases�	mimetypes�url�
version_added�re�90IGNORECASE�flagsrr�Single�	Multiline�joinr91�	DATATYPES�PSEUDO_TYPESr�Builtinr�KEYWORDSrr�Variabler�Float�Integerrr�AffixrAr�tokensr^r�r`r@rr�s����$�D��Z�(�G�$�%�I�92&�C��M��M�M�E��Z� �
����(�
�W�&�&�(<�=�
�C�H�H�>�&8�&B�&B�/�<�<�'=�>�>�>�@F�G��\�\�
��%�.�.�u�
=�w�G�
$�h�/�
�H��
�t�}�}�%�
6����E�
����'�
�����v�}�}� E�x�P�
�h�v�|�|�V�[�[�A�>�R�
4�6G�H�
�4� �)�$�-�-�8�
��,�/93�4�W�&�&�(<�=�
�W�&�&��/�
��)�)�*�
�g�'�'�(�	94��v�}�}�%�
�F�M�M�"�
�6�=�=�&�)�95��v�{�{�#�
�F�K�K� �
�6�;�;��'�96�K*�Fr`rc	��\rSrSrSrSrS/rS/rSrSr	\97Rr\
RR5VVVs0sH98upXSS_M snnnr\"\S	5H8urr\S99\:XdM\"\R,\R.-SS9\4\S	\'C O	 S5eS\R24S\4S\R64S\R84/\S	SS
&Srgs snnnf)r��z/100Handle the extra syntax in Pl/pgSQL language.101zPL/pgSQLr)ztext/x-plpgsqlz4https://www.postgresql.org/docs/current/plpgsql.htmlreNr�r&rsrtrzSQL keywords not foundz\%[a-z]\w*\bz:=z\<\<[a-z]\w*\>\>z\#[a-z]\w*\br�)rYrZr[r\r]r�r�r�r�r�r�r�r�rr��items�	enumerate�i�patternrrr102r��PLPGSQL_KEYWORDSrr�r�Label�Pseudor^�ror��states000r@rr�s����D��k�G�!�"�I�103@�C��M��M�M�E�2?�2F�2F�2L�2L�2N�
O�2N��$�d�!�H�n�2N�
O�F� ��v��/�104��7��1�:�� ��(�1�1�(�9�9�:�BG�I��!�F�6�N�1����0�	+�*�*�q�105�$�,�,�'�	���	�d�j�j�)�	�'�.�.�)�	�F�6�N�2�A���Ps�Crc	��\rSrSrSrSr/r\Rr	\106RR5VVVs0sH107upXSS_M snnnr\SRS\RS45 S\S4S	\4S\R4S108\R&4S\R*4S\R,4S
\R.4/\S'Srgs snnnf)�PsqlRegexLexer��z�109Extend the PostgresLexer adding support specific for psql commands.110 111This is not a complete psql lexer yet as it lacks prompt support112and output rendering.113z'PostgreSQL console - regexp based lexerNr�z\\[^\s]+zpsql-commandz\nrfrz�'(''|[^'])*'z	`([^`])*`z[^\s]+r�)rYrZr[r\r]r�r�r�r�r�rr�r�rTrr�rrrr�rr��Backtick�Symbolr^r�s000r@r�r��s����5�D��G��M�M�E�2?�2F�2F�2L�2L�2N�
O�2N��$�d�!�H�n�2N�
O�F�114�6�N���	�g�n�n�n�5�7�115��f��	���	�g�n�n�%�	$�d�m�m�4�	�&�-�-�(�	�v���'�	�F�M�M�"��F�>���	Ps�B>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�4�\rSrSrSrSrSrSrSr\r	Sr116g)	�	lookaheadiz0Wrap an iterator and allow pushing back an item.c�2�[U5UlSUlgrF)�iter�	_nextitem)rH�xs  r@�__init__�lookahead.__init__s����G��	���r`c��U$rFr�)rHs r@�__iter__�lookahead.__iter__"s���r`c��XlU$rF)r�)rHr�s  r@�send�lookahead.send%s�����r`c�p�URbURnSUlU$[UR5$rF)r��nextr�)rH�nis  r@�__next__�lookahead.__next__)s/���>�>�%����B�!�D�N��I��D�I�I��r`)r�r�N)rYrZr[r\r]r�r�r�r�r�r^r�r`r@r�r�s ��:������Dr`r�c�<�\rSrSrSrSr/SQrS/rSrSr	Sr117S	rS118rg)ri2z119Lexer for psql sessions.120zPostgreSQL console (psql))�psqlzpostgresql-consolezpostgres-consoleztext/x-postgresql-psqlrdrezpsql/psql_session.txtc#�# �[S0URD6n[[R	U55nSn/nUH�nURS5(a7U(d0[
S	0URD6nURU5Shv�N  O�[RU5nUb[UR[U5S[RUR54/45 XF[UR55S-
nOXF-
n[RU5(d[ R#U5(dM� O [%UURU55Shv�N [R&n	UGHn[RU5nUbUR)U5  O�[*RU5n121U122b�U123RS5RS5(d%U124RS5RS5(a[R,n	U125R/S5[R0U126RS54v� U127R/S5X�RS54v� M�SX�4v� GM gGMEGN�GN#7f)128Nr&��$r�ERROR�FATALr*r�)�console)r�rRr��line_re�findallrSr
r<�	re_promptr1rT�lenr�Promptr5�re_psql_command�re_end_command�searchr�Outputr��129re_message�Errorr9�Strong)rH�datarM�lines�curcode�130insertions�liner=�mprompt�	out_token�mmsgs           r@r<�+PostgresConsoleLexer.get_tokens_unprocessed>s����,�t�|�|�,���'�/�/�$�/�0����G��J����?�?�3�'�'��-�H�4�<�<�H�E�$�;�;�D�A�A�A��$�/�/�$�/���&��%�%�s�7�|�)*�G�N�N�G�M�M�O�(L�'M�'O�P��C��
�
��$8�$9�:�:�G��O�G�131#�(�(��1�1�$�+�+�G�4�4��+�0%�Z�%(�%?�%?��%H�J�
J�
J� ���I���#�/�/�$�/���&��J�J�t�$��!�'�'��-���#��z�z�!�}�/�/��8�8��*�*�Q�-�2�2�7�;�;�$+�M�M�	��:�:�a�=�'�.�.�$�*�*�Q�-�H�H��:�:�a�=�)�Z�Z��]�C�C��i�.�.��"�i�B�(
J�s,�BJ�I<�B/J�:"J�I?�D J�?Jr�N)
rYrZr[r\r]r�r�r�r�r��_exampler<r^r�r`r@rr2s/���'�D�@�G�)�*�I�132&�C��M�&�H�:r`rc���\rSrSrSrSrS/rS/rS/rSr	Sr133/S	\4PS134\4PS\
"\R\5S4PS
\
"\R\\5S4P\"SSS9\R$4PS\
"\R$\54PS\R*4PS\
"\R,\5S4PS\
"\R,\\5S4PS\
"\\\5S4P\"SSS9\R,S4PS\R,S4PS\
"\\\R0\5S4P\"SSS9\R,4P\"SSS9\R24PS \
"\R2\\54P\"\R6SS9\4PS!\R84PS"\R,4PS#\R,4PS$\R,4PS%\
"\\\R:54PS&\S4PS'\R$4PS(\R>4PS)\R04PS*\R@4PS+\R$4PS,\
"\R,\\5S-4PS.\
"\R,\54PS/\R*4PS0\
"\R,\\R:\\54PS1\S24S3\S44S5\R24S6\4/S7\
"\R\5S4S8\
"\R\\5S4S1\S94S:\4S;\R:4S<\R:4S=\R:4S>\S4S?\S4S@\R:4SA\R:4SB\R:4SC\R:4SD\R:4SE\4SF\4SG\4S3\S44/SH\
"\\R:\5S44SI\R:S44/SJ\4SE\4SK\R4SL\R>4SM\R04S3\S44/SN\
"\R,\R:54SO\R,S4SP\R,S4/SQ\
"\RB\\\\54SR\4/S1\4SS\R:4S3\S44/ST\4SU\RD4SV\R24SM\R04SE\4/SW.	r#SXr$gY)Zri{z"135Handle PostgreSQL EXPLAIN output136zPostgreSQL EXPLAIN dialectzpostgres-explainz	*.explainztext/x-postgresql-explainz:https://www.postgresql.org/docs/current/using-explain.htmlz2.15z!(:|\(|\)|ms|kB|->|\.\.|\,|\/|=|%)z(\s+)z137(cost)(=?)�instrumentationz(actual)( )(=?))�actualzMemory Usagez138Disk Usage�Memory�Buckets�Batches�139originally�row�rows�Hits�Misses�	Evictions�	OverflowszPlanned Partitions�	Estimates�capacityz
distinct keys�lookupszhit percentzIndex Searches�StoragezDisk Maximum Storagersrtz.(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�Filterz140Merge Condz	Hash Condz141Index CondzRecheck CondzHeap BlockszTID Condz
Run ConditionzOrder Byz
Function CallzTable Function CallzInner UniquezParams EvaluatedzSingle Copy�SamplingzOne-Time Filterr��	Relationsz142Remote SQL�Disabled�	predicatez	Conflict �conflictz(InitPlan|SubPlan)( )(\d+)( )�	init_plan)zSort Methodr�z
Planning timez
Planning TimezExecution timezExecution TimezWorkers PlannedzWorkers Launched�Buffers�Planning�WorkerzQuery Identifier�TimezFull-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 )�Backwardz(Intersect|Except|Hash)z(CTE)( )(\w*)?z143(on|using)r�z144-?\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\)r|z(never executed)z[^)(]+z(\(cost)(=?)z(\(actual)( )(=?)�145expressionz(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"rvz::\w+z +r�z146\[\.\.\.\]z(\()([^\n]*)(\))z[^\n]*z=|\.\.z(rows|width|time|loops)z\d+\.\d+z(\d+)z(Resolution: )(\w+)z(Arbiter \w+:)z147(Filter: )z ([a-z_]*?)(\s*)(=)(\s*)(\'.*?\')z\, zreturns \$\d+(,\$\d+)?z:|kBz.(quicksort|top-N|heapsort|Average|Memory|Peak)z(external|merge|Disk|sort))	r�r�r�r�r�r�r�r�r�r�N)%rYrZr[r\r]r�r��	filenamesr�r�r�rrrr�Classrrr�rrr��Preprocrr��	Exceptionr148�EXPLAIN_KEYWORDS�Typer�rr��Constant�	Attribute�Prepocr�r^r�r`r@rr{s ���(�D�!�"�G��
�I�,�-�I�149F�C��M�_150�
1�;�?�_151�
�z�"�_152��H�T�Z�Z��=�?P�Q�
_153� ��$�*�*�j�+�!N�Pa�b�_154��I�RW�	X�155�^�^�
�_156�"?�����Ya�@b�c�#_157�$$�W�^�^�4�%_158�*"�8�G�O�O�[�#I�6�R�+_159�0B�
�g�o�o�{�J�
?��
P�1_160�4-�h�w��Z�.X�Zg�h�5_161�:�;�162DI�J��_�_�k�

+�;_163�L�7�?�?�J�7�M_164�R.�
�g�z�6�>�>�:�
F�
�
�S_165�Z�=�FK�	L�NU�_�_�	
^�[_166�j�6� �!�#'�.�.�
2�k_167�r$�X�d�n�n�k�:�%V�W�s_168�v�%�6�6�u�
E�w�O�w_169�|3�G�L�L�A�}_170�~6�w���G�_171�@�'�/�/�*�A_172�B(����9�C_173�F���*�d�m�m� L�M�G_174�N�K��7�O_175�V�f�m�m�,�W_176�Z�F�L�L�)�[_177�\����(�]_178�b�d�m�m�,�c_179�f(����8�g_180�j!�(�7�?�?�K��"T�V_�`�k_181�p2�8�G�O�O�[�3Y�Z�q_182�rX�Y`�Yg�Yg�h�s_183�x(�
�g�o�o�z�4�=�=�+�z�
Z�
\�y_184�F�K��)�
�K��(�
 �$�.�.�1�
�� �
185��h�t�z�z�;�?�AR�S�
!�8�D�J�J�186�K�#P�Rc�d��K��.�
�k�"�
6��
�
�F�
)�4�=�=�9�
����'��[�-�0�
�;�
�.�+�D�M�M�:�
*�D�M�M�:�
��
�
�.��t�}�}�%�
�t�}�}�%�
�J��
�;��
�K�(�
�K��(�? 187�F!�(�;��
�
�{�"S�U[�\�
��
�
�v�.�	188���$�
�J��
'����4�
�&�,�,�'�
�v�~�~�&�
�K��(�
189�$�X�g�o�o�t�}�}�%M�N�
�����?�
�G�O�O�[�9�190�1�(�4�>�>�:�W_�ak�ms�2t�u�
�[�!�191�192�K� �
&��
�
�6�
�K��(�193��k�"�
>����O�
*�D�N�N�;�
�v�~�~�&�
�J��194�Mm�Fr`rc���\rSrSrSrSrS/rS/rS/rSr	Sr195\Rr
S	\4S196\R 4S\R"S4\"\R(S
S9\4\"\R,S
S9\R04S\4S\R64S\R 4S\R:4S\4S\4/S\R"S4S\R"S4S\R"4S\R"4/S.rSr Sr!g)ri7zs197Lexer for Structured Query Language. Currently, this lexer does198not recognize any special syntax except ANSI SQL.199�SQLrM�*.sqlz200text/x-sqlz!https://en.wikipedia.org/wiki/SQLr�rfrgrhrirsrtz[+*/<>=~!@#%^&|`?-]rwr��"(""|[^"])*"z[a-z_][\w$]*�[;:()\[\],.]r{r|r}r~�r�ric��grFr�)rHr2s  r@�analyse_text�SqlLexer.analyse_text\s��r`r�N)"rYrZr[r\r]r�r�rr�r�r�r�r�r�rrr�r�rrr�rr�rr�rrr�rr�rr�rr^r�r`r@rr7s���201�D��g�G��	�I���I�202-�C��M��M�M�E��Z� �
����(�
�W�&�&�(<�=�
�=�)�)�%�
8�'�B�
�=�*�*�5�
9�4�<�<�H�
#�X�.�
����'�
�f�m�m�,�
�f�m�m�,�
�d�#�
�k�*�
203��W�&�&�(<�=�
�W�&�&��/�
��)�)�*�
�g�'�'�(�	204��F�.r`rc��\rSrSrSrSrSS/rS/rS/rSr	S	r205\Rr
S206\4S\R 4S\R"S
4\"\R(5\4\"\R,SS9\R.4\"\R0SS9\R44\"\R6SS9\R84S\"\\\R>54\"\R@SS9\4S\"\\\54S\!RD4S\!RF4S\!RF4S\!RF4S\!RH4S\%R 4S\%RL4S\'4S\RP4S\RR4S\"\R>\'54S\4S\RRRT4/S\R"S
4S\R"S 4S!\R"4S"\R"4/S#.r+S$r,S%r-g&)'r i`z�207Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to208SQL.209 210The list of keywords includes ODBC and keywords reserved for future use.211zTransact-SQL�tsqlzt-sqlrztext/x-tsqlzhttps://www.tsql.infor�rfz--.*[$|\n]?rhrirsrtz(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]+rwr�rz[;(),.]z@@\w+z@\w+z(\w+)(:)z#?#?\w+�\?r{r|r}r~rc��Sn[RU5(aSnU$[[R	U55n[[212R	U55nX#-nUS:�aUSU-:�aUS-
nOX2:�aUS-
nOUS:�aUS-
n[RU5bUS-
n[RU5bUS-
nU$)Nrg�?r&r*��?皙�����?皙�����?)�tsql_declare_rer�r��name_between_backtick_rer��name_between_bracket_re�tsql_variable_re�213tsql_go_re�r2�rating�name_between_backtick_count�name_between_bracket_count�dialect_name_counts     r@r�TransactSqlLexer.analyse_text�s������!�!�$�'�'��F�,�
�)+.�(�0�0��6�+8�'�),�'�/�/��5�*7�&�214"=�!Y��!�Q�&�)�Q�1L�-L�L��#�
��+�I��#�
��+�a�/��#�
���&�&�t�,�8��#�
��� � ��&�2��#�
���
r`r�N).rYrZr[r\r]r�r�rr�r�r�r�r�r�rrr�r�rr�	OPERATORSr�OPERATOR_WORDS�Word�TYPESrr�	FUNCTIONS�Functionrrr�r�r�Hexr�r�rr�rr�r��Magicr�rr^r�r`r@r r `s�����D��w��G��	�I���I�215!�C��M��M�M�E��Z� �
�W�^�^�,�
�W�&�&�(<�=�
�>�+�+�
,�h�7�
�>�0�0��
?����O�
�>�'�'��
6��216�217�C�
�>�+�+�E�
:�D�M�M�J�
"�H�W�j�$�*�*�$M�N�
�>�*�*�5�
9�7�C�
��(�D�(�!C�D�
�V�Z�Z�(�
-�v�|�|�<�
'����6�
"�F�L�L�1�
����'�
�f�m�m�,�
�f�m�m�,�
��%��t�|�|�$�
�d�m�m�$�
�(�4�:�:�{�;�<�
���
�D�M�M�'�'�(�;218�@�W�&�&�(<�=�
�W�&�&��/�
��)�)�*�
�g�'�'�(�	219�A&�F�Pr`r c
�@�\rSrSrSrSrS/rS/rSrSr	\220Rr/S\
4PS	\R4PS221\R S4PS\R"S
4PS\R&4PS\R&4PS\R(4PS\R(4PS\R*4PS\R*4PS\R*4PS\R,4PS\R04PS\R04PS\R04PS\RS4PS\R4S4PS\R84PS\R84PS\R8S 4PS!\R8S"4PS#\R8S$4PS%\R84PS&\4PS'\4PS(\"\\
\54P\ "\!RDS)S)S*9\RF4P\ "\!RHS)S)S*9\RJ4P\ "\!RLS)S)S*9\4P\ "\!RNS)S+S*9\"\RP\
\)54PS,\4PS-\RTS.4PS/\)4PS0\R 4S1\R S24\ "\!RVS)S39\RX4S4\R 4S5\R 4/S6\R"4S1\R"S24S5\R"4/S7\R4S8\RZ4S9\RZ4S\RS24/S:\R44S;\RZ4S9\RZ4S\R4S24/S<\R84S8\R84S\R8S24/S=\R84S;\R84S\R8S24/S>\R84S?\R84S-\R8S24/S>\RT4S?\RTRZ4S-\RTS24/S@.	r.SAr/SBr0gC)Dr!i�a!The Oracle MySQL lexer.222 223This lexer does not attempt to maintain strict compatibility with224MariaDB syntax or keywords. Although MySQL and MariaDB's common code225history suggests there may be significant overlap between the two,226compatibility between the two is not a target for this lexer.227�MySQL�mysqlztext/x-mysqlzhttps://www.mysql.comr�rf�
(?:#|--\s+).*z/\*\+�optimizer-hintsrh�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*\}r��single-quoted-stringr��double-quoted-string�9@@(?:global\.|persist\.|persist_only\.|session\.)?[a-z_]+�
@[a-z0-9_$.]+�@'�single-quoted-variable�@"�double-quoted-variable�@`�backtick-quoted-variablerz[!%&*+/:<=>^|~-]+�\b(set)(?!\s*\()�\b(character)(\s+)(set)\brs��prefixru�\b(\s*)(\()�[0-9a-z$_€-￿]+�`�schema-object-name�[(),.;]z[^*a-z]+r{r|rtz[a-z]+�\*�[^*]+�[^'\\]+r��\\[0'"bnrtZ\\%_]�[^"\\]+r�rr��[^`]+�``)	r�r3r4r=r>rBrDrFrNc���Sn[[RU55n[[RU55nX#-nUS:�aUSU-:�aUS-
nU$X#:�aUS-
nU$US:�aUS-
nU$)Nrr&r*rrr)r�rr�rr!s     r@r�MySqlLexer.analyse_text`s�����&)�$�,�,�T�2�'4�#�%(�#�+�+�D�1�&3�"�9�U����"�&�!�.H�*H�H��c�M�F�228�
�	)�
E��c�M�F��
�)�1�
,��c�M�F��
r`r�N)1rYrZr[r\r]r�r�r�r�r�r�r�r�rrr��Specialr�rr-�Binr�r�r�Dater�Doublerr�rrrrr	�MYSQL_CONSTANTSr�MYSQL_DATATYPESr�MYSQL_KEYWORDS�MYSQL_FUNCTIONSr,r�Quoted�MYSQL_OPTIMIZER_HINTSr�Escaper�rr^r�r`r@r!r!�s����D��i�G�� �I�229!�C��M��M�M�E�P230�
�Z� �P231��w�~�~�.�	P232�233�w���(9�:�P234��W�&�&�(;�<�
P235�"�6�:�:�.�P236��V�Z�Z�(�P237��&�*�*�%�P238�����$�P239�".�v�|�|�<�#P240�$.�v�|�|�<�%P241�&#�F�L�L�1�'P242�(3�F�N�N�C�)P243�.Z�
�\�\�
�/P244�6k�
�\�\�
�7P245�@&�246���

�?P247�R�6�=�=�"8�9�SP248�T�6�=�=�"8�9�UP249�ZJ�4�=�=�Y�[P250�\�t�}�}�-�]P251�^�D�M�M�#;�<�_P252�`�D�M�M�#;�<�aP253�b�D�M�M�#=�>�cP254�d�D�M�M�"�eP255�j"�8�,�kP256�p!�'�*�qP257�r*�8�G�Z��+Q�R�sP258�x�?�2�2�5��
O�
�]�]�
�yP259�|�?�2�2�5��
O�
�\�\�
�}P260�@�?�1�1�%��
N�
�
�AP261�D�?�2�2�5��
X�
�d�m�m�Z��
=�
?�EP262�V(��.�WP263�X�4�;�;� 4�5�YP264�^��%�_P265�l�'�/�/�*�
�W�_�_�f�-�
�?�8�8��
G�
�_�_�
�
�w���'�
�G�O�O�$�
266��w�(�(�)�
�W�&�&��/�
�G�%�%�&�267�����'�
�F�M�M�"�
$�f�m�m�4�
�6�=�=�&�)�	!268�����'�
�F�M�M�"�
$�f�m�m�4�
�6�=�=�&�)�	!269��t�}�}�%�
�D�M�M�"�
�4�=�=�&�)�#270��t�}�}�%�
�D�M�M�"�
�4�=�=�&�)�#271��t�}�}�%�
�D�M�M�"�
�4�=�=�&�)�%272��t�{�{�#�
�D�K�K�&�&�'�
�4�;�;��'�273�gX�F�tr`r!c��\rSrSrSrSrSS/rSS/rSS	/rS274r	Sr275\Rr
/S\4PS
\R 4PS\R"S4PS\R&4PS\R&4PS\R(4PS\R(4PS\R*4PS\R*4PS\R*4PS\R,4PS\R04PS\R04PS\R04PS\R S4PS\R4S4PS\R84PS \R84PS!\R8S"4PS#\R8S$4PS%\R8S&4PS'\R84PS(\4PS)\"\\\54P\"\ RBS*S*S+9\RD4P\"\ RFS*S*S+9\RH4P\"\ RJS*S*S+9\4P\"\ RLS*S,S+9\"\RN\\(54P\"\ RRS*S*S+9\*4PS-\4PS.\RVS/4PS0\(4PS1\R"4S2\R"S34S4\R"4/S5\R 4S6\RX4S7\RX4S\R S34/S8\R44S9\RX4S7\RX4S\R4S34/S:\R84S6\R84S\R8S34/S;\R84S9\R84S\R8S34/S<\R84S=\R84S.\R8S34/S<\RV4S=\RVRX4S.\RVS34/S>.r-S?r.S@r/gA)Brisz�276GoogleSQL is Google's standard SQL dialect, formerly known as ZetaSQL.277 278The list of keywords includes reserved words for future use.279�	GoogleSQL�	googlesql�zetasqlz*.googlesqlz*.googlesql.sqlztext/x-google-sqlztext/x-google-sql-auxz+https://cloud.google.com/bigquery/googlesqlz2.19rfr2rhr4r5rr6r7rr8rr9r:r;r<r�r=r�r>r?r@rArBrCrDrErFrrGrHrsrIrKrLrMrNrOrQr{r|rPrRr�rSrTr�rr�rUrV)r�r4r=r>rBrDrFrNc��[R"UR55nS[SUR	555-$)Ng����MbP?c3�B# �UHupU[;dMUv� M g7frF)�googlesql_identifiers)ro�t�counts   r@rq�.GoogleSqlLexer.analyse_text.<locals>.<genexpr>s"���:��X�Q��#8�8�!�5��s��	)�collections�Counter�split�sumr�)r2r�s  r@r�GoogleSqlLexer.analyse_text
s>���$�$�T�Z�Z�\�2���s�:�����:�:�:�	:r`r�N)0rYrZr[r\r]r�r�rr�r�r�r�r�r�rrr�r�rr-rZr�r�rr[rr\rr�rrrr�	constantsr�typesr�keywords�
functionnamesr,r�	operatorsrrarcr�rr^r�r`r@rrss�����D��I�&�G�� 1�2�I�$�&=�>�I�2807�C��M��M�M�E�J281�
�Z� �J282��w�~�~�.�	J283�284�W�&�&�(;�<�J285�"�6�:�:�.�J286��V�Z�Z�(�J287��&�*�*�%�J288�����$�J289� .�v�|�|�<�!J290�".�v�|�|�<�#J291�$#�F�L�L�1�%J292�&3�F�N�N�C�'J293�,Z�
�\�\�
�-J294�4k�
�\�\�
�5J295�>&�296���

�=J297�P�6�=�=�"8�9�QJ298�R�6�=�=�"8�9�SJ299�XJ�4�=�=�Y�YJ300�Z�t�}�}�-�[J301�\�D�M�M�#;�<�]J302�^�D�M�M�#;�<�_J303�`�D�M�M�#=�>�aJ304�b�D�M�M�"�cJ305�h!�'�*�iJ306�j*�8�G�Z��+Q�R�kJ307�p�&�0�0��u�
M�t�}�}�]�qJ308�r�&�,�,�U�5�
I�7�<�<�X�sJ309�t�&�/�/��e�
L�g�V�uJ310�v�&�4�4�U�>�
Z�
�d�m�m�Z��
=�
?�wJ311�z�&�0�0��u�
M�x�X�{J312�J(��.�KJ313�L�4�;�;� 4�5�MJ314�R��%�SJ315�`�w�(�(�)�
�W�&�&��/�
�G�%�%�&�316�����'�
�F�M�M�"�
$�f�m�m�4�
�6�=�=�&�)�	!317�����'�
�F�M�M�"�
$�f�m�m�4�
�6�=�=�&�)�	!318��t�}�}�%�
�D�M�M�"�
�4�=�=�&�)�#319��t�}�}�%�
�D�M�M�"�
�4�=�=�&�)�#320��t�}�}�%�
�D�M�M�"�
�4�=�=�&�)�%321��t�{�{�#�
�D�K�K�&�&�'�
�4�;�;��'�322�II�F�V:r`rc�@�\rSrSrSrSrS/rS/rS/rSr	Sr323S	rS324rSr
g)
r"iz+325Lexer for example sessions using sqlite3.326�327sqlite3con�sqlite3z*.sqlite3-consoleztext/x-sqlite3-consolezhttps://www.sqlite.orgz0.11zsqlite3/sqlite3.sqlite3-consolec	#��# �[S0URD6nSn/n[RU5GHnUR	5n[328R
U5nUb^UR[U5S[RUSS4/45 UR[U5S[S4/45 X6SS-
nM�U(a'[UURU55Shv�N Sn/nURS5(a%UR5[R U4v� M�UR5[R"U4v� GM U(a$[UURU55Shv�N ggN�N7f)Nr�rr/rm�zSQL error: r�)rrRr�r7r5�sqlite_prompt_rer1rTr�rr�rrr<rSr9�	Tracebackr�)rHr�rMr�r�r1r��prompt_matchs        r@r<�)SqliteConsoleLexer.get_tokens_unprocessed sh����&����&�����329��%�%�d�+�E��;�;�=�D�+�1�1�$�7�L��'��!�!�3�w�<�%&�����R�a��$A�#B�#D�E��!�!�3�w�<�%&�330�C�$8�#9�#;�<����8�#���,�Z�-0�-G�-G��-P� R�R�R� �G�!#�J��?�?�=�1�1� �;�;�=�'�*;�*;�T�B�B� �;�;�=�'�.�.�$�?�?�%,�&�$�Z�%(�%?�%?��%H�J�
J�
J��R�
J�s%�CE<� E8�!BE<�1E:�2E<�:E<r�N)rYrZr[r\r]r�r�rr�r�r�r�r<r^r�r`r@r"r"s:����D��k�G�$�%�I�)�*�I�331"�C��M�0�H�Jr`r"c���\rSrSrSrSrSrS/rS/rS/r	Sr332\Rr
S	S333\4S\4S\4S
\R$4S\R(4S\4S\R,4S\R,4S\4/	0rSrg)r#i=z$334Lexer for Relation Query Language.335�RQLz"http://www.logilab.org/project/rql�rqlz*.rqlz336text/x-rqlz2.0r�rfz�(DELETE|SET|INSERT|UNION|DISTINCT|WITH|WHERE|BEING|OR|AND|NOT|GROUPBY|HAVING|ORDERBY|ASC|DESC|LIMIT|OFFSET|TODAY|NOW|TRUE|FALSE|NULL|EXISTS)\bz337[+*/<>=%-]z)(Any|is|instance_of|CWEType|CWRelation)\brwz[A-Z_]\w*\??r�rr
r�N)rYrZr[r\r]r�r�r�rr�r�r�r�r�rrrrr�rr�rr�rr�r^r�r`r@r#r#=s�����D�338.�C��g�G��	�I���I��M��M�M�E��
�Z� �5�6=�
?��H�%�
9�4�<�<�H�
����'�
�d�#�
�f�m�m�,�
�f�m�m�,�
�k�*�339��Fr`r#)@r]rnr��pygments.lexerrrrrr�pygments.lexersrr	r340rrr
r�pygments.tokenrrrrrrrrrrr�__all__�compiler�r}r�r0r:rrr rrrvrurtrjrArCrrr�r�r�r��re_errorr�r�rrrr r!rr"r#r�r`r@�<module>r�s0��(�T�	�L�L�/�+�.�)�*�<�4�4�4�4�O���:�:�g����:�:�9�:���j�j�3�R�]�]�C��341�342�343�9�b�m�m�,���*�*�%8�9���:�:�&7�8��
�Z�Z�	�2�=�=�
1�344��*�*�-�r�}�}�=���:�:�0�1���%�%��"�"�#���� ��!3�H"�"�J6�L�*�6�r �<�� �F�\�:��6
�J�J�5�6�	��*�*�X�&�����,�-���*�*�2�3��
�:�:�'�(��
�Z�Z�7�8�345�346��,F�5�F�Ry�:�y�x&�z�&�RS�z�S�lz��z�z]:�Z�]:�@'J��'J�T�z�r`
codekingpro/portable-devtools · Team Ai