관리-도구
편집 파일: _parser.cpython-38.pyc
U ʗReiX � @ sD d dl mZ d dlmZ d dlZd dlmZ d dlmZm Z m Z ddlmZm Z mZmZmZmZ ddlmZmZmZ ed d � ed�D ��eed��B Zeed � Zeed� ZeZeZeZed�Zeed�B Z eej!ej" d �Z#e#ed�B Z$eej%�Z&edd dddddd��Z'G dd� de(�Z)e*d�dddd�d d!�Z+e*d�d"ddd#�d$d%�Z,G d&d'� d'�Z-G d(d)� d)�Z.G d*d+� d+e �Z/d"d,d-d,d.�d/d0�Z0d"d,d"d1d2d,d3�d4d5�Z1d"d,d,d6�d7d8�Z2d"d,d,d6�d9d:�Z3d"d,d+d;d<�d=d>�Z4d"d,d+d;d<�d?d@�Z5d"d,d+dAdd,dB�dCdD�Z6d"d,ddEdF�dGdH�Z7d"d,d;d6�dIdJ�Z8d"d,dKd6�dLdM�Z9d"d,dKd6�dNdO�Z:d"d,ddPdF�dQdR�Z;d"d,ddSdF�dTdU�Z<dVdW�d"d,d2dKdX�dYdZ�Z=d"d,dKd6�d[d\�Z>d"d,d]dKd^�d_d`�Z?d"d,dKd6�dadb�Z@d"d,d2dKdc�ddde�ZAd"d,d2dKdX�dfdg�ZBd"d,ddhdF�didj�ZCd"d,d"ddk�dldm�ZDd]d2dn�dodp�ZEdddq�drds�ZFdS )t� )�annotations)�IterableN)�MappingProxyType)�Any�BinaryIO� NamedTuple� )�RE_DATETIME�RE_LOCALTIME� RE_NUMBER�match_to_datetime�match_to_localtime�match_to_number)�Key� ParseFloat�Posc c s | ]}t |�V qd S �N)�chr��.0�i� r ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/tomli/_parser.py� <genexpr> s r � � � z z � z-_z"'��� �"�\)z\bz\tz\nz\fz\rz\"z\\c @ s e Zd ZdZdS )�TOMLDecodeErrorz0An error raised if a document is not valid TOML.N)�__name__� __module__�__qualname__�__doc__r r r r r# 5 s r# ��parse_floatr r zdict[str, Any])�__fpr) �returnc C s@ | � � }z|�� }W n tk r2 td�d�Y nX t||d�S )z%Parse TOML from a binary file object.zEFile must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`Nr( )�read�decode�AttributeError� TypeError�loads)r* r) �b�sr r r �load9 s ��r3 �str)�__sr) r+ c C s~ | � dd�}d}tt� t� �}d}t|�}t||t�}z|| }W n tk r\ Y �qvY nX |dkrp|d7 }q*|tkr�t |||||�}t||t�}n�|dk�rz||d }W n tk r� d}Y nX |j �� |dkr�t|||�\}}nt |||�\}}t||t�}n|dk�r"t||d ��t||�}z|| }W n tk �rT Y �qvY nX |dk�rlt||d ��|d7 }q*|jjS )zParse TOML from a string.z r r r r �[N�#zInvalid statementz5Expected newline or end of document after a statement)�replace�Output� NestedDict�Flags�make_safe_parse_float� skip_chars�TOML_WS� IndexError�KEY_INITIAL_CHARS�key_value_rule�flags�finalize_pending�create_list_rule�create_dict_rule�suffixed_err�skip_comment�data�dict)r5 r) �src�pos�out�header�char�second_charr r r r0 E sR � r0 c @ s| e Zd ZdZdZdZdd�dd�Zdd dd �dd�Zdd�d d�Zddd�dd�Z dd ddd�dd�Z dd dd �dd�ZdS )r; z)Flags that map to parsed keys/namespaces.r r �None�r+ c C s i | _ t� | _d S r )�_flags�set�_pending_flags��selfr r r �__init__� s zFlags.__init__r �int)�key�flagr+ c C s | j �||f� d S r )rT �add�rV rY rZ r r r �add_pending� s zFlags.add_pendingc C s. | j D ]\}}| j||dd� q| j �� d S )NF�� recursive)rT rS �clearr\ r r r rC � s zFlags.finalize_pending�rY r+ c C sF | j }|d d� D ]}||kr$ d S || d }q|�|d d � d S )N����nested)rR �pop)rV rY �cont�kr r r � unset_all� s zFlags.unset_all�bool)rY rZ r_ r+ c C s� | j }|d d� |d }}|D ],}||kr@t� t� i d�||<