Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/pygments/__pycache__/ |
Upload File : |
o ���a � @ 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-2021 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 �3/usr/lib/python3/dist-packages/pygments/regexopt.py�<lambda> s zmake_charset.<locals>.<lambda>� �])� CS_ESCAPE�sub�join)�lettersr r r �make_charset s r c s� |rdpd}| s dS | d � t | �dkr|t� � | S � s-|t| dd� d� d | S t � �dkrlg }g }| D ]}t |�dkrG|�|� q9|�|� q9t |�dkrl|rd|t|d� d t|� | S |t|� | S t| �}|r�t |��|t|� t�fd d �| D �d� | S dd � | D �}t|�}|r�t |��|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"