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/python2.7/dist-packages/mercurial/parser.pyc
ó
ÛXc@@s¬ddlmZddlmZddlmZdefd„ƒYZd„Zd„Z	d	„Z
d
„Zd„Zd„Z
d
efd„ƒYZdefd„ƒYZdS(i(tabsolute_importi(t_(terrortparsercB@sbeZd
d„Zd„Zd„Zd„Zd
d„Zdd„Zd„Z	d„Z
d	„ZRS(cC@s||_||_d|_dS(N(t	_elementst_methodstNonetcurrent(tselftelementstmethods((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt__init__s		cC@s"|j}t|jdƒ|_|S(sadvance the tokenizerN(Rtnextt_iterR(Rtt((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt_advances	cC@st|j|jddd!ƒS(s%True if next token may start new termiii(tanyRR(R((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt_hasnewterm"scC@sN|jd|kr@tjtdƒ|jd|jdƒ‚n|jƒdS(s0make sure the tokenizer matches an end conditionisunexpected token: %siN(RRt
ParseErrorRR(Rtm((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt_match%scC@sK|r"|jd|kr"d}n|j|ƒ}|rG|j|ƒn|S(sDgather right-hand-side operand until an end condition or binding metiN(RRt_parseR(RtbindRtexpr((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt
_parseoperand+s	ic
C@s[|jƒ\}}}|j|dd!\}}|rW|oD|jƒrW||f}nB|r}|d|j|dŒf}ntjtdƒ||ƒ‚x»||j|jddkrV|jƒ\}}}|j|d\}}	|	r|oû|jƒr|	|f}qœ|r7|d||j|dŒf}qœtjtdƒ||ƒ‚qœW|S(Niiisnot a prefix: %ssnot an infix: %s(RRRRRRRR(
RRttokentvaluetpostprimarytprefixRtinfixtsuffix((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyR4s  !# cC@s;||_|jƒ|jƒ}|j\}}}||fS(s!generate a parse tree from tokens(R
RRR(Rt	tokenitertresRRR((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pytparseJs
	
cC@sHt|tƒs|S|j|dg|dD]}|j|ƒ^q,ŒS(s4recursively evaluate a parse tree using node methodsii(t
isinstancettupleRteval(RttreeR((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyR%QscC@s)|j|ƒ}|jr%|j|ƒS|S(s<parse tokens into a parse tree and evaluate if methods given(R"RR%(RR R((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt__call__Vs	
N(t__name__t
__module__RRRRRRRR"R%R'(((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRs						cC@szt|ƒt|ƒkrHtjtdƒi|d6t|ƒd6ƒ‚ni}x;t||ƒD]*\}}|d|kr~Pn|||<q^Wxç|t|ƒD]Õ}|d|ksÇ|dd|krêtjtdƒi|d6ƒ‚n|dd}||kr.tjtdƒi|d6|d6ƒ‚n||krdtjtd	ƒi|d6|d6ƒ‚n|d
||<qW|S(s¶Build dict from list containing positional and keyword arguments

    Invalid keywords or too many positional arguments are rejected, but
    missing arguments are just omitted.
    s*%(func)s takes at most %(nargs)d argumentstfunctnargsiis %(func)s got an invalid arguments5%(func)s got an unexpected keyword argument '%(key)s'tkeys;%(func)s got multiple values for keyword argument '%(key)s'i(tlenRRRtzip(ttreestfuncnametkeystkeyvaluenodetkeynodetargstktx((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt
buildargsdict]s*!$cC@sFy|jdƒSWn.tk
rA}tjt|ƒjƒƒ‚nXdS(Nt
string_escape(tdecodet
ValueErrorRRtstrtlower(tste((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pytunescapestr}scC@s®t|tƒs |d|kr<|j|t|ƒfƒnn|j|d|dfƒx)|dD]}t|||d|ƒqbW|dd|dddfg|d)dS(Nis(%siiÿÿÿÿt)(R#R$tappendR;t
_prettyformat(R&t	leafnodestleveltlinesR=((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRB„s cC@s6g}t||d|ƒdjd„|Dƒƒ}|S(Nis
cs@s#|]\}}d||VqdS(s  N((t.0tlR=((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pys	<genexpr>s(RBtjoin(R&RCREtoutput((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pytprettyformatsc@sÐt|tƒs|S|d}|ˆkrN|ft‡fd†|dDƒƒSg}|}x@|d|krœ|d\}}|jt|ˆƒƒ|}q]W|jt|ˆƒƒ|j|ƒtt|ƒƒS(sFlatten chained infix operations to reduce usage of Python stack

    >>> def f(tree):
    ...     print prettyformat(simplifyinfixops(tree, ('or',)), ('symbol',))
    >>> f(('or',
    ...     ('or',
    ...       ('symbol', '1'),
    ...       ('symbol', '2')),
    ...     ('symbol', '3')))
    (or
      ('symbol', '1')
      ('symbol', '2')
      ('symbol', '3'))
    >>> f(('func',
    ...     ('symbol', 'p1'),
    ...     ('or',
    ...       ('or',
    ...         ('func',
    ...           ('symbol', 'sort'),
    ...           ('list',
    ...             ('or',
    ...               ('or',
    ...                 ('symbol', '1'),
    ...                 ('symbol', '2')),
    ...               ('symbol', '3')),
    ...             ('negate',
    ...               ('symbol', 'rev')))),
    ...         ('and',
    ...           ('symbol', '4'),
    ...           ('group',
    ...             ('or',
    ...               ('or',
    ...                 ('symbol', '5'),
    ...                 ('symbol', '6')),
    ...               ('symbol', '7'))))),
    ...       ('symbol', '8'))))
    (func
      ('symbol', 'p1')
      (or
        (func
          ('symbol', 'sort')
          (list
            (or
              ('symbol', '1')
              ('symbol', '2')
              ('symbol', '3'))
            (negate
              ('symbol', 'rev'))))
        (and
          ('symbol', '4')
          (group
            (or
              ('symbol', '5')
              ('symbol', '6')
              ('symbol', '7'))))
        ('symbol', '8')))
    ic3@s|]}t|ˆƒVqdS(N(tsimplifyinfixops(RFR6(ttargetnodes(s4/usr/lib/python2.7/dist-packages/mercurial/parser.pys	<genexpr>Ñsi(R#R$RARKtreversed(R&RLtopt
simplifiedR6RGtr((RLs4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRK“s:
%

cC@sFt|jƒdkr7tdƒ|jd|jdfS|jdSdS(s;Compose error message from specified ParseError object
    is	at %s: %siN(R-R4R(tinst((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pytparseerrordetailàs"taliascB@seZdZd„ZRS(sParsed result of aliascC@s1||_||_||_||_t|_dS(N(tnameR4RtreplacementtFalsetwarned(RRTR4terrRU((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRës
				(R(R)t__doc__R(((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRSèstbasealiasrulescB@sÈeZdZdZdZd„Zed„ƒZed„ƒZ	e
d„ƒZe
d„ƒZe
d„ƒZ
e
d„ƒZe
d	„ƒZe
d
„ƒZe
d„ƒZe
d„ƒZe
d
„ƒZRS(swParsing and expansion rule set of aliases

    This is a helper for fileset/revset/template aliases. A concrete rule set
    should be made by sub-classing this and implementing class/static methods.

    It supports alias expansion of symbol and funciton-call styles::

        # decl = defn
        h = heads(default)
        b($1) = ancestors($1) - ancestors(default)
    tsymbolcC@std|jƒ‚dS(Ns'%s' is not instantiatable(t	TypeErrorR((tcls((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt__new__scC@s
t‚dS(s-Parse an alias name, arguments and definitionN(tNotImplementedError(tspec((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyR	scC@s
t‚dS(s9Return (name, args) if tree is a function; otherwise NoneN(R_(R&((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt_trygetfuncsc@sjyˆj|ƒ}Wn&tjk
r;}|d
t|ƒfSX|dˆjkrŒ|d}|jdƒr|d
tdƒ|fS|d
d
fSˆj|ƒ}|rW|\}}|jdƒrÓ|d
tdƒ|fSt	‡fd†|Dƒƒr|d
tdƒfSt
|ƒt
t|ƒƒkr3|d
tdƒfS|g|D]}|d^q=d
fS|d
td	ƒfS(sA
Parse an alias declaration into ``(name, args, errorstr)``

        This function analyzes the parsed tree. The parsing rule is provided
        by ``_parse()``.

        - ``name``: of declared alias (may be ``decl`` itself at error)
        - ``args``: list of argument names (or None for symbol declaration)
        - ``errorstr``: detail about detected error (or None)

        >>> sym = lambda x: ('symbol', x)
        >>> symlist = lambda *xs: ('list',) + tuple(sym(x) for x in xs)
        >>> func = lambda n, a: ('func', sym(n), a)
        >>> parsemap = {
        ...     'foo': sym('foo'),
        ...     '$foo': sym('$foo'),
        ...     'foo::bar': ('dagrange', sym('foo'), sym('bar')),
        ...     'foo()': func('foo', None),
        ...     '$foo()': func('$foo', None),
        ...     'foo($1, $2)': func('foo', symlist('$1', '$2')),
        ...     'foo(bar_bar, baz.baz)':
        ...         func('foo', symlist('bar_bar', 'baz.baz')),
        ...     'foo(bar($1, $2))':
        ...         func('foo', func('bar', symlist('$1', '$2'))),
        ...     'foo($1, $2, nested($1, $2))':
        ...         func('foo', (symlist('$1', '$2') +
        ...                      (func('nested', symlist('$1', '$2')),))),
        ...     'foo("bar")': func('foo', ('string', 'bar')),
        ...     'foo($1, $2': error.ParseError('unexpected token: end', 10),
        ...     'foo("bar': error.ParseError('unterminated string', 5),
        ...     'foo($1, $2, $1)': func('foo', symlist('$1', '$2', '$1')),
        ... }
        >>> def parse(expr):
        ...     x = parsemap[expr]
        ...     if isinstance(x, Exception):
        ...         raise x
        ...     return x
        >>> def trygetfunc(tree):
        ...     if not tree or tree[0] != 'func' or tree[1][0] != 'symbol':
        ...         return None
        ...     if not tree[2]:
        ...         return tree[1][1], []
        ...     if tree[2][0] == 'list':
        ...         return tree[1][1], list(tree[2][1:])
        ...     return tree[1][1], [tree[2]]
        >>> class aliasrules(basealiasrules):
        ...     _parse = staticmethod(parse)
        ...     _trygetfunc = staticmethod(trygetfunc)
        >>> builddecl = aliasrules._builddecl
        >>> builddecl('foo')
        ('foo', None, None)
        >>> builddecl('$foo')
        ('$foo', None, "invalid symbol '$foo'")
        >>> builddecl('foo::bar')
        ('foo::bar', None, 'invalid format')
        >>> builddecl('foo()')
        ('foo', [], None)
        >>> builddecl('$foo()')
        ('$foo()', None, "invalid function '$foo'")
        >>> builddecl('foo($1, $2)')
        ('foo', ['$1', '$2'], None)
        >>> builddecl('foo(bar_bar, baz.baz)')
        ('foo', ['bar_bar', 'baz.baz'], None)
        >>> builddecl('foo($1, $2, nested($1, $2))')
        ('foo($1, $2, nested($1, $2))', None, 'invalid argument list')
        >>> builddecl('foo(bar($1, $2))')
        ('foo(bar($1, $2))', None, 'invalid argument list')
        >>> builddecl('foo("bar")')
        ('foo("bar")', None, 'invalid argument list')
        >>> builddecl('foo($1, $2')
        ('foo($1, $2', None, 'at 10: unexpected token: end')
        >>> builddecl('foo("bar')
        ('foo("bar', None, 'at 5: unterminated string')
        >>> builddecl('foo($1, $2, $1)')
        ('foo', None, 'argument names collide with each other')
        iit$sinvalid symbol '%s'sinvalid function '%s'c3@s"|]}|dˆjkVqdS(iN(t_symbolnode(RFR(R](s4/usr/lib/python2.7/dist-packages/mercurial/parser.pys	<genexpr>rssinvalid argument lists&argument names collide with each othersinvalid formatN(RRRRRRRct
startswithRRaRR-tset(R]tdeclR&RQRTR*R4R((R]s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt
_builddecls(M

$c@sÀt|tƒs|S|d}|ˆjkrT|ft‡‡fd†|dDƒƒSt|ƒdkslt‚|d}|ˆkr‹d}n+|jdƒr¶tjtdƒ|ƒ‚n||fS(s%Mark alias arguments as ``_aliasarg``ic3@s!|]}ˆj|ˆƒVqdS(N(t_relabelargs(RFR6(R4R](s4/usr/lib/python2.7/dist-packages/mercurial/parser.pys	<genexpr>siit	_aliasargRbsinvalid symbol '%s'(	R#R$RcR-tAssertionErrorRdRRR(R]R&R4RNtsym((R4R]s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRhzs
(
	cC@s=|j|ƒ}|r$t|ƒ}n	tƒ}|j||ƒS(s9Parse an alias definition into a tree and marks substitutions

        This function marks alias argument references as ``_aliasarg``. The
        parsing rule is provided by ``_parse()``.

        ``args`` is a list of alias argument names, or None if the alias
        is declared as a symbol.

        >>> parsemap = {
        ...     '$1 or foo': ('or', ('symbol', '$1'), ('symbol', 'foo')),
        ...     '$1 or $bar': ('or', ('symbol', '$1'), ('symbol', '$bar')),
        ...     '$10 or baz': ('or', ('symbol', '$10'), ('symbol', 'baz')),
        ...     '"$1" or "foo"': ('or', ('string', '$1'), ('string', 'foo')),
        ... }
        >>> class aliasrules(basealiasrules):
        ...     _parse = staticmethod(parsemap.__getitem__)
        ...     _trygetfunc = staticmethod(lambda x: None)
        >>> builddefn = aliasrules._builddefn
        >>> def pprint(tree):
        ...     print prettyformat(tree, ('_aliasarg', 'string', 'symbol'))
        >>> args = ['$1', '$2', 'foo']
        >>> pprint(builddefn('$1 or foo', args))
        (or
          ('_aliasarg', '$1')
          ('_aliasarg', 'foo'))
        >>> try:
        ...     builddefn('$1 or $bar', args)
        ... except error.ParseError as inst:
        ...     print parseerrordetail(inst)
        invalid symbol '$bar'
        >>> args = ['$1', '$10', 'foo']
        >>> pprint(builddefn('$10 or baz', args))
        (or
          ('_aliasarg', '$10')
          ('symbol', 'baz'))
        >>> pprint(builddefn('"$1" or "foo"', args))
        (or
          ('string', '$1')
          ('string', 'foo'))
        (RReRh(R]tdefnR4R&((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt
_builddefn‹s
*	c	C@s¼d}}|j|ƒ\}}}|r7tdƒ}nGy|j||ƒ}Wn.tjk
r}}t|ƒ}tdƒ}nX|r©|i|jd6|d6|d6}nt||||ƒS(s>Parse an alias declaration and definition into an alias objects4bad declaration of %(section)s "%(name)s": %(error)ss3bad definition of %(section)s "%(name)s": %(error)stsectionRTRN(	RRgRRmRRRRt_sectionRS(	R]RfRltrepltefmtRTR4RXRQ((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pytbuild¼s
%cC@s@i}x3|D]+\}}|j||ƒ}|||j<q
W|S(sTParse a list of alias (name, replacement) pairs into a dict of
        alias objects(RrRT(R]titemstaliasesRfRlta((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pytbuildmapÍs
cC@s·t|tƒsdS|d|jkra|d}|j|ƒ}|ra|jdkra|dfSn|j|ƒ}|r³|\}}|j|ƒ}|r³|jdk	r³||fSndS(srIf tree looks like an unexpanded alias, return (alias, pattern-args)
        pair. Return None otherwise.
        iiN(R#R$RRctgetR4Ra(R]RtR&RTRuR*R4((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt	_getalias×s


c@sRt|tƒs|S|ddkr5|d}ˆ|St‡‡fd†|DƒƒS(soReplace _aliasarg instances with the substitution value of the
        same name in args, recursively.
        iRiic3@s!|]}ˆj|ˆƒVqdS(N(t_expandargs(RFR(R4R](s4/usr/lib/python2.7/dist-packages/mercurial/parser.pys	<genexpr>õs(R#R$(R]R&R4Rk((R4R]s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRyës
c
@s¯t|tƒs|Sˆjˆ|ƒ}|dkrTt‡‡‡‡fd†|DƒƒS|\}}|jr~tj|jƒ‚n|ˆkrºtjtdƒiˆjd6|j	d6ƒ‚nˆj
|ƒ|j	ˆkrûˆjˆ|jˆˆƒˆ|j	<nˆ|j	}ˆj
ƒ|jdkr%|St|ƒt|jƒkrbtjtdƒt|ƒƒ‚ng|D]}	ˆjˆ|	gˆƒ^qi}ˆj|tt|j|ƒƒƒS(Nc3@s'|]}ˆjˆ|ˆˆƒVqdS(N(t_expand(RFR(RttcacheR]t	expanding(s4/usr/lib/python2.7/dist-packages/mercurial/parser.pys	<genexpr>ýss5infinite expansion of %(section)s "%(name)s" detectedRnRTsinvalid number of arguments: %d(R#R$RxRRtAbortRRRoRTRARzRUtpopR4R-RytdictR.(
R]RtR&R|R{RPRuRGtresultR((RtR{R]R|s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRz÷s2	!


+cC@s|j||giƒS(sExpand aliases in tree, recursively.

        'aliases' is a dictionary mapping user defined aliases to alias objects.
        (Rz(R]RtR&((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pytexpandsN(R(R)RYRRoRcR^tstaticmethodRRatclassmethodRgRhRmRrRvRxRyRzR(((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyRZõs	g1
N(t
__future__Rti18nRtRtobjectRR7R?RBRJRKRRRSRZ(((s4/usr/lib/python2.7/dist-packages/mercurial/parser.pyt<module>sE	 					M