HEX
Server: Apache
System: Linux sg2plmcpnl492417.prod.sin2.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: nyiet8349bzl (9207396)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/site-packages/pip/_vendor/pygments/__pycache__/regexopt.cpython-38.pyc
U

��e�@sldZddlZddlmZddlmZddlmZddlmZe�	d�Z
ed�Zdd	�Zd
d�Z
dd
d�ZdS)a
    pygments.regexopt
    ~~~~~~~~~~~~~~~~~

    An algorithm that generates optimized regexes for matching long lists of
    literal strings.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�escape)�commonprefix)�groupby)�
itemgetterz[\[\^\\\-\]]cCsdt�dd�d�|��dS)N�[cSsd|��S)N�\)�group)�m�r
�A/tmp/pip-unpacked-wheel-uzdrexel/pip/_vendor/pygments/regexopt.py�<lambda>�zmake_charset.<locals>.<lambda>��])�	CS_ESCAPE�sub�join)�lettersr
r
r�make_charsetsrc		s�|rdp
d}|sdS|d�t|�dkr8|t��|S�sZ|t|dd�d�d|St��dkr�g}g}|D]&}t|�dkr�|�|�qr|�|�qrt|�dkr�|r�|t|d�dt|�|S|t|�|St|�}|�rt|��|t|�t�fd	d
�|D�d�|Sdd
�|D�}t|�}|�rpt|��|tt�fdd
�|D��d�t|ddd��|S|d�dd
�t|�fdd��D��|S)zEReturn a regex that matches any string in the sorted list of strings.�)rr�Nz(?:�?�|csg|]}|�d��qS�Nr
��.0�s)�plenr
r�
<listcomp>?sz#regex_opt_inner.<locals>.<listcomp>cSsg|]}|ddd��qS)N���r
rr
r
rrBsc3s|]}|d��VqdSrr
r)�slenr
r�	<genexpr>Hsz"regex_opt_inner.<locals>.<genexpr>rcss |]}tt|d�d�VqdS)rrN)�regex_opt_inner�list)rrr
r
rr!Ms�cs|d�dkS)Nrr
)r)�firstr
rrNr
z!regex_opt_inner.<locals>.<lambda>)	�lenrr"�appendrr�sortedrr)	�stringsZ
open_parenZclose_parenZ	oneletter�restr�prefixZstrings_rev�suffixr
)r$rr rr"sj����
�����
���r"rcCst|�}|t|d�|S)z�Return a compiled regex that matches any string in the given list.

    The strings to match must be literal strings, not regexes.  They will be
    regex-escaped.

    *prefix* and *suffix* are pre- and appended to the final regex.
    �()r'r")r(r*r+r
r
r�	regex_optRsr-)rr)�__doc__�rer�os.pathr�	itertoolsr�operatorr�compilerZ
FIRST_ELEMENTrr"r-r
r
r
r�<module>s
8