File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/pyparsing/__pycache__/actions.cpython-310.pyc
Back
o �ha � @ s d dl mZ d dlmZmZmZ ddlmZ ddlm Z m Z ddlmZ eeg ef eegef ee egef eee egef f ZG dd� d�Zd)d d�Zd*dd�Zd+dd�Zd,dd�Ze� e_d-d.d!d"�Ze d#e�Ze d$e�Ze d%e�Ze d&e�Ze d'e�Zd(S )/� )�annotations)�Union�Callable�Any� )�ParseException)�col�replaced_by_pep8)�ParseResultsc @ s, e Zd ZdZddd�Zddd�Zdd� ZdS )�OnlyOncez� Wrapper for parse actions, to ensure they are only called once. Note: parse action signature must include all 3 arguments. �method_call�'Callable[[str, int, ParseResults], Any]�return�Nonec C s ddl m} ||�| _d| _d S )Nr )�_trim_arityF)�corer �callable�called)�selfr r � r �G/usr/local/CyberPanel/lib/python3.10/site-packages/pyparsing/actions.py�__init__ s zOnlyOnce.__init__�s�str�l�int�tr c C s* | j s| �|||�}d| _ |S t||d��)NTz.OnlyOnce obj called multiple times w/out reset)r r r )r r r r �resultsr r r �__call__ s zOnlyOnce.__call__c C s d| _ dS )zK Allow the associated parse action to be called once more. FN)r )r r r r �reset&