관리-도구
편집 파일: regexopt.cpython-38.pyc
U &?�f � @ sl d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ e� d�Z ed�Zdd � Zd d� Z dd d�ZdS )a pygments.regexopt ~~~~~~~~~~~~~~~~~ An algorithm that generates optimized regexes for matching long lists of literal strings. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � N)�escape)�commonprefix)�groupby)� itemgetterz[\[\^\\\-\]]c C s dt �dd� d�| �� d S )N�[c S s d| � � S )N�\)�group)�m� r �K/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/pygments/regexopt.py�<lambda> � zmake_charset.<locals>.<lambda>� �])� CS_ESCAPE�sub�join)�lettersr r r �make_charset s r c s� |rdp d}| sdS | d � t | �dkr8|t� � | S � sZ|t| dd� d� d | S t � �dkr�g }g }| D ]&}t |�dkr�|�|� qr|�|� qrt |�dkr�|r�|t|d� d t|� | S |t|� | S t| �}|�rt |��|t|� t�fd d �| D �d� | S dd � | D �}t|�}|�rpt |��|tt�fdd �| D ��d� t|ddd� � | S |d�dd � t| � fdd��D �� | S )zEReturn a regex that matches any string in the sorted list of strings.�)r r � Nz(?:�?�|c s g | ]}|� d � �qS �Nr ��.0�s)�plenr r � <listcomp>? s z#regex_opt_inner.<locals>.<listcomp>c S s g | ]}|d d d� �qS )N���r r r r r r B s c 3 s | ]}|d � � V qd S r r r )�slenr r � <genexpr>H s z"regex_opt_inner.<locals>.<genexpr>r c s s | ]}t t|d �d�V qdS )r r N)�regex_opt_inner�list)r r r r r r! M s �c s | d � d kS )Nr r )r )�firstr r r N r z!regex_opt_inner.<locals>.<lambda>) �lenr r"