← Back
Editing: jslex.cpython-311.pyc
� �|�e � �p � d Z ddlZ G d� d� � Zdd�Z G d� d� � Z G d � d e� � Zd� ZdS ) zJsLex: a lexer for Javascript� Nc � � e Zd ZdZdZdd�ZdS )�Tokz, A specification for a token class. r Nc �| � t j | _ t xj dz c_ || _ || _ || _ d S )N� )r �num�id�name�regex�next)�selfr r r s �4/usr/lib/python3/dist-packages/django/utils/jslex.py�__init__zTok.__init__ s3 � ��'������1������ ��� ��� � � � �N)�__name__� __module__�__qualname__�__doc__r r � r r r r s9 � � � � � �� � �C�� � � � � r r � c �n ��� d� ��fd�| � � � D � � � � S )z� Create a regex from a space-separated list of literal `choices`. If provided, `prefix` and `suffix` will be attached to each choice individually. �|c 3 �L �K � | ]}�t j |� � z �z V � �d S r )�re�escape)�.0�c�prefix�suffixs ��r � <genexpr>zliterals.<locals>.<genexpr> s5 �� � � �L�L�q�F�R�Y�q�\�\�)�F�2�L�L�L�L�L�Lr )�join�split)�choicesr r s ``r �literalsr$ s8 ��� � �8�8�L�L�L�L�L�G�M�M�O�O�L�L�L�L�L�Lr c � � e Zd ZdZd� Zd� ZdS )�Lexerz2 A generic multi-state regex-based lexer. c �j � i | _ i | _ |� � � D ]�\ }}g }|D ]7}d|j z }|| j |<