Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/site-packages/yaml/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/yaml/__pycache__/parser.cpython-37.pyc

B

b�`�c�@sNddgZddlmZddlTddlTddlTGdd�de�ZGdd�d�ZdS)�Parser�ParserError�)�MarkedYAMLError)�*c@seZdZdS)rN)�__name__�
__module__�__qualname__�r	r	�>/opt/alt/python37/lib64/python3.7/site-packages/yaml/parser.pyrEsc@seZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdDd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�ZdEd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdFd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCS)Gr�!ztag:yaml.org,2002:)rz!!cCs*d|_d|_i|_g|_g|_|j|_dS)N)�
current_event�yaml_version�tag_handles�states�marks�parse_stream_start�state)�selfr	r	r
�__init__QszParser.__init__cCsg|_d|_dS)N)rr)rr	r	r
�disposeYszParser.disposecGsN|jdkr|jr|��|_|jdk	rJ|s,dSx|D]}t|j|�r2dSq2WdS)NTF)rr�
isinstance)r�choices�choicer	r	r
�check_event^s



zParser.check_eventcCs |jdkr|jr|��|_|jS)N)rr)rr	r	r
�
peek_eventks

zParser.peek_eventcCs*|jdkr|jr|��|_|j}d|_|S)N)rr)r�valuer	r	r
�	get_eventrs

zParser.get_eventcCs(|��}t|j|j|jd�}|j|_|S)N)�encoding)�	get_tokenZStreamStartEvent�
start_mark�end_markr�parse_implicit_document_startr)r�token�eventr	r	r
rs


zParser.parse_stream_startcCs\|�ttt�sP|j|_|��}|j}}t||dd�}|j	�
|j�|j|_
|S|��SdS)NF)�explicit)�check_token�DirectiveToken�DocumentStartToken�StreamEndToken�DEFAULT_TAGSr�
peek_tokenr�DocumentStartEventr�append�parse_document_end�parse_block_noder�parse_document_start)rr"rr r#r	r	r
r!�s
z$Parser.parse_implicit_document_startcCs�x|�t�r|��qW|�t�s�|��}|j}|��\}}|�t�sdtddd|��j	|��j��|��}|j
}t||d||d�}|j�
|j�|j|_n0|��}t|j|j
�}|jr�t�|jr�t�d|_|S)Nz)expected '<document start>', but found %rT)r$�version�tags)r%�DocumentEndTokenrr(r*r�process_directivesr'r�idr r+rr,r-�parse_document_contentrZStreamEndEvent�AssertionErrorr)rr"rr0r1r r#r	r	r
r/�s.





zParser.parse_document_startcCsL|��}|j}}d}|�t�r2|��}|j}d}t|||d�}|j|_|S)NFT)r$)	r*rr%r2rr ZDocumentEndEventr/r)rr"rr r$r#r	r	r
r-�s

zParser.parse_document_endcCs<|�tttt�r0|�|��j�}|j�	�|_
|S|��SdS)N)r%r&r'r2r(�process_empty_scalarr*rr�poprr.)rr#r	r	r
r5�s
zParser.parse_document_contentcCsd|_i|_x�|�t�r�|��}|jdkrp|jdk	rDtddd|j��|j\}}|dkrftddd|j��|j|_q|jdkr|j\}}||jkr�tddd||j��||j|<qW|jr�|j|j�	�f}n
|jdf}x(|j
D]}||jkr�|j
||j|<q�W|S)NZYAMLzfound duplicate YAML directiverz:found incompatible YAML document (version 1.* is required)ZTAGzduplicate tag handle %r)r
rr%r&r�namerrr�copyr))rr"�major�minor�handle�prefixr�keyr	r	r
r3�s8









zParser.process_directivescCs|jdd�S)NT)�block)�
parse_node)rr	r	r
r.szParser.parse_block_nodecCs|��S)N)rA)rr	r	r
�parse_flow_nodeszParser.parse_flow_nodecCs|jddd�S)NT)r@�indentless_sequence)rA)rr	r	r
�'parse_block_node_or_indentless_sequencesz.Parser.parse_block_node_or_indentless_sequenceFc	CsR|�t�r4|��}t|j|j|j�}|j��|_	�nd}d}d}}}	|�t
�r�|��}|j}|j}|j}|�t�r�|��}|j}	|j}|j}nF|�t�r�|��}|j}}	|j}|j}|�t
�r�|��}|j}|j}|dk	�r&|\}
}|
dk	�r"|
|jk�rt
d|d|
|	��|j|
|}n|}|dk�r>|��j}}d}|dk�pR|dk}|�r�|�t��r�|��j}t|||||�}|j|_	�n�|�t��r|��}|j}|j�r�|dk�s�|dk�r�d}n|dk�r�d}nd}t||||j|||jd�}|j��|_	�nH|�t��r<|��j}t|||||dd	�}|j|_	�n|�t��rp|��j}t|||||dd	�}|j|_	n�|�r�|�t��r�|��j}t|||||d
d	�}|j|_	n�|�r�|�t��r�|��j}t|||||d
d	�}|j|_	nj|dk	�s�|dk	�rt|||d
fd||�}|j��|_	n2|�r(d}
nd
}
|��}t
d|
|d|j|j��|S)Nzwhile parsing a nodezfound undefined tag handle %rr)TF)FT)FF)�styleT)�
flow_styleF�r@Zflowzwhile parsing a %s nodez'expected the node content, but found %r) r%Z
AliasTokenrZ
AliasEventrrr rr8rZAnchorTokenZTagTokenrrr*�BlockEntryTokenZSequenceStartEvent�parse_indentless_sequence_entryZScalarToken�plain�ScalarEventrEZFlowSequenceStartToken�parse_flow_sequence_first_entryZFlowMappingStartToken�MappingStartEvent�parse_flow_mapping_first_keyZBlockSequenceStartToken� parse_block_sequence_first_entryZBlockMappingStartToken�parse_block_mapping_first_keyr4)rr@rCr"r#�anchor�tagrr Ztag_markr=�suffixZimplicit�noder	r	r
rAs�


















zParser.parse_nodecCs|��}|j�|j�|��S)N)rrr,r�parse_block_sequence_entry)rr"r	r	r
rOxsz'Parser.parse_block_sequence_first_entrycCs�|�t�rH|��}|�tt�s4|j�|j�|��S|j|_|�	|j
�S|�t�sv|��}td|j
dd|j|j��|��}t|j|j
�}|j��|_|j
��|S)Nz while parsing a block collection���z"expected <block end>, but found %r)r%rHr�
BlockEndTokenrr,rUr.rr7r r*rrr4r�SequenceEndEventr8)rr"r#r	r	r
rU}s 


z!Parser.parse_block_sequence_entrycCsr|�t�rL|��}|�tttt�s8|j�|j�|�	�S|j|_
|�|j�S|�
�}t|j|j�}|j��|_
|S)N)r%rHr�KeyToken�
ValueTokenrWrr,rIr.rr7r r*rXrr8)rr"r#r	r	r
rI�s

z&Parser.parse_indentless_sequence_entrycCs|��}|j�|j�|��S)N)rrr,r�parse_block_mapping_key)rr"r	r	r
rP�sz$Parser.parse_block_mapping_first_keycCs�|�t�rJ|��}|�ttt�s6|j�|j�|��S|j|_	|�
|j�S|�t�sx|��}t
d|jdd|j|j��|��}t|j|j�}|j��|_	|j��|S)Nzwhile parsing a block mappingrVz"expected <block end>, but found %r)r%rYrrZrWrr,�parse_block_mapping_valuerDrr7r r*rrr4r�MappingEndEventr8)rr"r#r	r	r
r[�s 


zParser.parse_block_mapping_keycCsl|�t�rL|��}|�ttt�s6|j�|j�|��S|j|_	|�
|j�Sn|j|_	|��}|�
|j
�SdS)N)r%rZrrYrWrr,r[rDrr7r r*r)rr"r	r	r
r\�s
z Parser.parse_block_mapping_valuecCs"|��}|j�|j�|jdd�S)NT)�first)rrr,r�parse_flow_sequence_entry)rr"r	r	r
rL�sz&Parser.parse_flow_sequence_first_entrycCs�|�t�s�|sF|�t�r"|��n$|��}td|jdd|j|j��|�t	�r||��}t
ddd|j|jdd�}|j|_
|S|�t�s�|j�|j�|��S|��}t|j|j�}|j��|_
|j��|S)Nzwhile parsing a flow sequencerVzexpected ',' or ']', but got %rT)rF)r%�FlowSequenceEndToken�FlowEntryTokenrr*rrr4rrYrMr �%parse_flow_sequence_entry_mapping_keyrrr,r_rBrXr8)rr^r"r#r	r	r
r_�s,





z Parser.parse_flow_sequence_entrycCsD|��}|�ttt�s,|j�|j�|��S|j|_	|�
|j�SdS)N)rr%rZrar`rr,�'parse_flow_sequence_entry_mapping_valuerBrr7r )rr"r	r	r
rb�sz,Parser.parse_flow_sequence_entry_mapping_keycCsj|�t�rJ|��}|�tt�s4|j�|j�|��S|j|_	|�
|j�Sn|j|_	|��}|�
|j
�SdS)N)r%rZrrar`rr,�%parse_flow_sequence_entry_mapping_endrBrr7r r*r)rr"r	r	r
rcs
z.Parser.parse_flow_sequence_entry_mapping_valuecCs|j|_|��}t|j|j�S)N)r_rr*r]r)rr"r	r	r
rdsz,Parser.parse_flow_sequence_entry_mapping_endcCs"|��}|j�|j�|jdd�S)NT)r^)rrr,r�parse_flow_mapping_key)rr"r	r	r
rNsz#Parser.parse_flow_mapping_first_keycCs�|�t�s�|sF|�t�r"|��n$|��}td|jdd|j|j��|�t	�r�|��}|�t
tt�s||j�|j
�|��S|j
|_|�|j�Sn |�t�s�|j�|j�|��S|��}t|j|j�}|j��|_|j��|S)Nzwhile parsing a flow mappingrVzexpected ',' or '}', but got %r)r%�FlowMappingEndTokenrarr*rrr4rrYrZrr,�parse_flow_mapping_valuerBrr7r �parse_flow_mapping_empty_valuer]r8)rr^r"r#r	r	r
res.





zParser.parse_flow_mapping_keycCsj|�t�rJ|��}|�tt�s4|j�|j�|��S|j|_	|�
|j�Sn|j|_	|��}|�
|j
�SdS)N)r%rZrrarfrr,rerBrr7r r*r)rr"r	r	r
rg9s
zParser.parse_flow_mapping_valuecCs|j|_|�|��j�S)N)rerr7r*r)rr	r	r
rhGsz%Parser.parse_flow_mapping_empty_valuecCstdddd||�S)N)TFrG)rK)rZmarkr	r	r
r7KszParser.process_empty_scalarN)FF)F)F)#rrrr)rrrrrrr!r/r-r5r3r.rBrDrArOrUrIrPr[r\rLr_rbrcrdrNrergrhr7r	r	r	r
rHsB

	/
g


N)�__all__�errorr�tokens�events�scannerrrr	r	r	r
�<module>>s

Hacked By AnonymousFox1.0, Coded By AnonymousFox