0x1949 Team - FAZEMRX - MANAGER
Edit File: tokens.cpython-310.pyc
o �|�aoA � @ s d dl Z d dlZd dlmZ d dlZd dlmZmZ d dlmZ zd dl m Z mZmZm Z mZmZmZ W n eyC dZdd� ZY nw erLd d lmZ e �d �Ze �de j�Ze �de j�Ze �d e j�ZG dd� d�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� de�Z!G dd� de�Z"G d d!� d!e�Z#G d"d#� d#e�Z$G d$d%� d%e#�Z%G d&d'� d'e#�Z&G d(d)� d)e�Z'G d*d+� d+e�Z(G d,d-� d-e�Z)d.e ee*e+f d/e e fd0d1�Z,d2d3� Z-e-d4d5� �Z.e-d6d7� �Z/dS )8� N)� ReferenceType)�resolve_ref�_strI)�BufferingIterator)�Optional�cast� TYPE_CHECKING�Iterable�Union�Dict�CallableFc C s |S �N� )�t�vr r �=/usr/lib/python3/dist-packages/debian/_deb822_repro/tokens.py�<lambda> s r )� Deb822Elementz^\s+$a� (?P<space_before>\s*) # Consume any whitespace before the word # The space only occurs in practise if the line starts # with space. # Optionally consume a word (needed to handle the case # when there are no words left and someone applies this # pattern to the remaining text). This is mostly here as # a fail-safe. (?P<word>\S+) # Consume the word (if present) (?P<trailing_whitespace>\s*) # Consume trailing whitespace a� # This regex is slightly complicated by the fact that it should work with # finditer and comsume the entire value. # # To do this, we structure the regex so it always starts on a comma (except # for the first iteration, where we permit the absence of a comma) (?: # Optional space followed by a mandatory comma unless # it is the start of the "line" (in which case, we # allow the comma to be omitted) ^ | (?: (?P<space_before_comma>\s*) # This space only occurs in practise if the line # starts with space + comma. (?P<comma> ,) ) ) # From here it is "optional space, maybe a word and then optional space" again. One reason why # all of it is optional is to gracefully cope with trailing commas. (?P<space_before_word>\s*) (?P<word> [^,\s] (?: [^,]*[^,\s])? )? # "Words" can contain spaces for comma separated list. # But surrounding whitespace is ignored (?P<space_after_word>\s*) a� ^ # Start of line (?P<field_name> # Capture group for the field name [\x21\x22\x24-\x2C\x2F-\x39\x3B-\x7F] # First character [\x21-\x39\x3B-\x7F]* # Subsequent characters (if any) ) (?P<separator> : ) (?P<space_before_value> \s* ) (?: # Field values are not mandatory on the same line # as the field name. (?P<value> \S(?:.*\S)? ) # Values must start and end on a "non-space" (?P<space_after_value> \s* ) # We can have optional space after the value )? c @ sz e Zd ZdZdZdd� Zdd� Zdd� Zed d � �Z edd� �Z ed d� �Zdd� Zedd� �Z e jdd� �Z dd� ZdS )�Deb822Tokena> A token is an atomic syntactical element from a deb822 file A file is parsed into a series of tokens. If these tokens are converted to text in exactly the same order, you get exactly the same file - bit-for-bit. Accordingly ever bit of text in a file must be assigned to exactly one Deb822Token. )�_text�_hash�_parent_element�__weakref__c C s. |dkrt d��|| _d | _d | _| �� d S )N� zTokens must have content)� ValueErrorr r r �_verify_token_text��self�textr r r �__init__b s zDeb822Token.__init__c C s. | j dkrdj| jj| j �dd�d�S | jjS )Nr z{clsname}('{text}')� z\n)�clsnamer )r �format� __class__�__name__�replace�r r r r �__repr__k s �zDeb822Token.__repr__c C sr d| j v r3d}| jst| t�rd}|s| jstd��| j�d�s$td��|r5d| jd d� v r7td��d S d S d S )Nr FTz>Only whitespace, error and comment tokens may contain newlinesz2Tokens containing whitespace must end on a newline���zNComments and error tokens must not contain embedded newlines (only end on one))r � is_comment� isinstance�Deb822ErrorToken� is_whitespacer r �endswith)r �is_single_line_tokenr r r r s s �zDeb822Token._verify_token_textc C � dS �NFr r&