HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/lib2to3/__pycache__/patcomp.cpython-35.pyc


Fa@sdZdZddlZddlZddlmZmZmZmZm	Z	m
Z
ddlmZddlm
Z
ejjejjedZGd	d
d
eZddZGd
ddeZdejdejdejddiZddZddZddZdS)zPattern compiler.

The grammar is taken from PatternGrammar.txt.

The compiler compiles a pattern to a pytree.*Pattern instance.
z#Guido van Rossum <guido@python.org>N)driverliteralstokentokenizeparsegrammar)pytree)pygramzPatternGrammar.txtc@seZdZdS)PatternSyntaxErrorN)__name__
__module____qualname__rr%/usr/lib/python3.5/lib2to3/patcomp.pyrsrc	csntjtjtjh}tjtj|j}x4|D],}|\}}}}}||kr:|Vq:WdS)z6Tokenizes a string suppressing significant whitespace.N)	rNEWLINEINDENTDEDENTrgenerate_tokensioStringIOreadline)	inputskiptokensZ	quintupletypevaluestartendZ	line_textrrrtokenize_wrapper!s
rc@sXeZdZeddZddddZddZdd	d
ZddZdS)
PatternCompilercCs^tj||_tj|j|_tj|_tj|_	tj
|jdt|_dS)z^Initializer.

        Takes an optional alternative filename for the pattern grammar.
        ZconvertN)rZload_grammarrr
ZSymbolssymsZpython_grammarZ	pygrammarZpython_symbolspysymsZDriverpattern_convert)selfZgrammar_filerrr__init__-s
zPatternCompiler.__init__FcCst|}y|jj|d|}Wn:tjk
rd}ztt|WYdd}~XnX|r~|j||fS|j|SdS)z=Compiles a pattern string to a nested pytree.*Pattern object.debugN)rrZparse_tokensrZ
ParseErrorrstrcompile_node)r$rr&Z	with_treerrooterrrcompile_pattern8s%zPatternCompiler.compile_patternc
s|jjjkr"|jd}|jjjkrfdd|jdddD}t|dkrz|dStjdd|Dddd	d}|jS|jjj	krfd
d|jD}t|dkr|dStj|gddd	d}|jS|jjj
krij|jdd}tj|}|jS|jjj
kstd}|j}t|dkr|djtjkr|dj}|dd}d}t|dkr#|djjjkr#|d}|dd}j||}|dk	r|jjjks\t|j}	|	d}
|
jtjkrd}tj}n|
jtjkrd}tj}n|
jtjkr<|	djtjkstt|	dkstj|	d}}t|	dkrHj|	d}nd
sHt|dks`|dkr|j}tj|ggd|d	|}|dk	r||_|jS)zXCompiles a node, recursively.

        This is one big switch on the node type.
        rcsg|]}j|qSr)r().0ch)r$rr
<listcomp>Ps	z0PatternCompiler.compile_node.<locals>.<listcomp>NrcSsg|]}|gqSrr)r,arrrr.Ss	minmaxcsg|]}j|qSr)r()r,r-)r$rrr.Ws	Fr5r5r5)r3r4)rr!ZMatcherchildrenZAlternativeslenr	WildcardPatternoptimizeZAlternativeZNegatedUnit
compile_basicZNegatedPatternZUnitAssertionErrorrEQUALrZRepeaterSTARZHUGEPLUSLBRACERBRACEget_intname)
r$nodeZaltspZunitspatternrBnodesrepeatr6Zchildr1r2r)r$rr(Dsh
)(


	(
+
	
!	zPatternCompiler.compile_nodeNcCst|dkst|d}|jtjkrbttj|j}t	j
t||S|jtjkrp|j}|j
r|tkrtd||ddrtdt	j
t|S|dkrd}n@|jds't|j|d}|dkr'td||ddrW|j|djdg}nd}t	j||Sns|jdkr|j|dS|jd	kr|dkst|j|d}t	j|ggd
dddSdst|dS)
NrrzInvalid token: %rzCan't have details for tokenany_zInvalid symbol: %r([r1r2F)r7r;rrSTRINGr'rZ
evalStringrr	ZLeafPattern_type_of_literalNAMEisupper	TOKEN_MAPr
startswithgetattrr"r(r6ZNodePatternr8)r$rFrGrCrrZcontent
subpatternrrrr:s<
		 zPatternCompiler.compile_basiccCs%|jtjkstt|jS)N)rrNUMBERr;intr)r$rCrrrrAszPatternCompiler.get_int)	rr
r_PATTERN_GRAMMAR_FILEr%r+r(r:rArrrrr +s
G#r rNrLrTZTOKENcCs9|djrtjS|tjkr1tj|SdSdS)Nr)isalpharrNrZopmap)rrrrrMs
rMcCsW|\}}}}|s'||jkr=tj||d|Stj||d|SdS)z9Converts raw node information to a Node or Leaf instance.contextN)Z
number2symbolr	ZNodeZLeaf)rZ
raw_node_inforrrXr6rrrr#sr#cCstj|S)N)r r+)rErrrr+sr+)__doc__
__author__rosZpgen2rrrrrrr	r
pathjoindirname__file__rV	Exceptionrrobjectr rNrLrTrPrMr#r+rrrr<module>	s$.