Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

P
‘°IÜÛ2ã
@s¨ddlZddlZddlmZddlTddlmZmZm	Z	dSddœe
eefe
eefe
eeeee
ed	œd
d„ZdTddœeeeeeed
œdd„Zeedœdd„Zeedœdd„ZdUdddœe
eeefe
e
e
e
e
edœdd„Zeeedœdd„ZdVddœee
e
edœdd „Zeedœd!d"„Zeedœd#d$„Zd%d&deƒfeƒd'œe
eefe
eefeeeeed(œd)d*„Zed+ƒed,ƒfd-d.„Ze
eefeeefd/œd0d1„Ze
eefeeefd/œd2d3„Z ee!e"e#d4ƒ $d5¡ƒ\Z%Z&d6d7„ej'j( )¡DƒZ*e+d8d9 ,e*¡d:ƒ $d;¡Z-d<d=„Z.Gd>d?„d?e/ƒZ0e
eeee
eefe
eefffZ1e
ee1ee0ee2fee1ee0ffZ3ed%ƒed&ƒfee4e3e
eefe
eefed@œdAdB„Z5dgfdCdD„Z6e7e+dEƒdFƒ $dG¡Z8e+dHƒ $dI¡Z9e+dJƒ :¡ $dK¡Z;e+dLƒ $dM¡Z<e7e+dEƒdFe<Bƒ $dN¡Z=e=Z>e+dOƒ $dP¡Z?dQdR„e@ƒ A¡DƒZBeZCeZDeZEeZFeZGeZHeZIeZJeZKe ZLe%e&ZMZNe-ZOe.ZPe0ZQe5ZRe8ZSe9ZTe;ZUe<ZVe=ZWe>ZXe?ZYdS)WéNé)Ú__diag__)Ú*)Ú_bslashÚ_flattenÚ_escape_regex_range_charsú,F)Úallow_trailing_delim)ÚexprÚdelimÚcombineÚminÚmaxr	ÚreturncCsÞt|tƒrt |¡}djt| ¡ ¡ƒt|ƒ|r>d t|ƒ¡ndd}|sRt|ƒ}|dk	rr|dkrjt	dƒ‚|d8}|dk	rš|dk	r’||kr’t	dƒ‚|d8}|||||f}|r¾|t
|ƒ7}|rÐt|ƒ |¡S| |¡SdS)	a/Helper to define a delimited list of expressions - the delimiter
    defaults to ','. By default, the list elements and delimiters can
    have intervening whitespace, and comments, but this can be
    overridden by passing ``combine=True`` in the constructor. If
    ``combine`` is set to ``True``, the matching tokens are
    returned as a single token string, with the delimiters included;
    otherwise, the matching tokens are returned as a list of tokens,
    with the delimiters suppressed.

    If ``allow_trailing_delim`` is set to True, then the list may end with
    a delimiter.

    Example::

        delimited_list(Word(alphas)).parse_string("aa,bb,cc") # -> ['aa', 'bb', 'cc']
        delimited_list(Word(hexnums), delim=':', combine=True).parse_string("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE']
    z{expr} [{delim} {expr}]...{end}z [{}]Ú)r
rÚendNrzmin must be greater than 0z)max must be greater than, or equal to min)
Ú
isinstanceÚstr_typeÚ
ParserElementÚ_literalStringClassÚformatÚstrÚcopyÚ
streamlineÚSuppressÚ
ValueErrorÚOptÚCombineÚset_name)r
rrr
rr	ÚdlNameZdelimited_list_expr©r ú/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/pyparsing/helpers.pyÚdelimited_list
s,

r")ÚintExpr)r
Úint_exprr#rcsr|p|}tƒ‰‡‡fdd„}|dkr8ttƒ dd„¡}n| ¡}| d¡|j|dd|ˆ d	tˆƒd
¡S)a~Helper to define a counted list of expressions.

    This helper defines a pattern of the form::

        integer expr expr expr...

    where the leading integer tells how many expr expressions follow.
    The matched tokens returns the array of expr tokens as a list - the
    leading count token is suppressed.

    If ``int_expr`` is specified, it should be a pyparsing expression
    that produces an integer value.

    Example::

        counted_array(Word(alphas)).parse_string('2 ab cd ef')  # -> ['ab', 'cd']

        # in this parser, the leading integer value is given in binary,
        # '10' indicating that 2 values are in the array
        binary_constant = Word('01').set_parse_action(lambda t: int(t[0], 2))
        counted_array(Word(alphas), int_expr=binary_constant).parse_string('10 ab cd ef')  # -> ['ab', 'cd']

        # if other fields must be parsed after the count but before the
        # list items, give the fields results names and they will
        # be preserved in the returned ParseResults:
        count_with_metadata = integer + Word(alphas)("type")
        typed_array = counted_array(Word(alphanums), int_expr=count_with_metadata)("items")
        result = typed_array.parse_string("3 bool True True False")
        print(result.dump())

        # prints
        # ['True', 'True', 'False']
        # - items: ['True', 'True', 'False']
        # - type: 'bool'
    cs,|d}ˆ|rˆ|ntƒK‰|dd…=dS)Nr)ÚEmpty)ÚsÚlÚtÚn)Ú
array_exprr
r r!Úcount_field_parse_actionrsz/counted_array.<locals>.count_field_parse_actionNcSst|dƒS)Nr)Úint)r(r r r!Ú<lambda>zózcounted_array.<locals>.<lambda>ÚarrayLenT)Zcall_during_tryz(len) z...)ÚForwardÚWordÚnumsÚset_parse_actionrrÚadd_parse_actionr)r
r$r#r+r )r*r
r!Ú
counted_arrayFs)
r5)r
rcs6tƒ‰‡fdd„}|j|ddˆ dt|ƒ¡ˆS)a9Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks for
    a 'repeat' of a previous expression.  For example::

        first = Word(nums)
        second = match_previous_literal(first)
        match_expr = first + ":" + second

    will match ``"1:1"``, but not ``"1:2"``.  Because this
    matches a previous literal, will also match the leading
    ``"1:1"`` in ``"1:10"``. If this is not desired, use
    :class:`match_previous_expr`. Do *not* use with packrat parsing
    enabled.
    csP|rBt|ƒdkrˆ|d>qLt| ¡ƒ}ˆtdd„|Dƒƒ>n
ˆtƒ>dS)Nrrcss|]}t|ƒVqdS)N)ÚLiteral)Ú.0Úttr r r!ú	<genexpr>šszImatch_previous_literal.<locals>.copy_token_to_repeater.<locals>.<genexpr>)ÚlenrÚas_listÚAndr%)r&r'r(Útflat)Úrepr r!Úcopy_token_to_repeater“sz6match_previous_literal.<locals>.copy_token_to_repeaterT)Ú
callDuringTryz(prev) )r0r4rr)r
r?r )r>r!Úmatch_previous_literal‚s
rAcsFtƒ‰| ¡}ˆ|K‰‡fdd„}|j|ddˆ dt|ƒ¡ˆS)aWHelper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks for
    a 'repeat' of a previous expression.  For example::

        first = Word(nums)
        second = match_previous_expr(first)
        match_expr = first + ":" + second

    will match ``"1:1"``, but not ``"1:2"``.  Because this
    matches by expressions, will *not* match the leading ``"1:1"``
    in ``"1:10"``; the expressions are evaluated first, and then
    compared, so ``"1"`` is compared with ``"10"``. Do *not* use
    with packrat parsing enabled.
    cs*t| ¡ƒ‰‡fdd„}ˆj|dddS)Ncs,t| ¡ƒ}|ˆkr(t||d ˆ|¡ƒ‚dS)NzExpected {}, found{})rr;ÚParseExceptionr)r&r'r(ÚtheseTokens)ÚmatchTokensr r!Úmust_match_these_tokens¹szTmatch_previous_expr.<locals>.copy_token_to_repeater.<locals>.must_match_these_tokensT)r@)rr;r3)r&r'r(rE)r>)rDr!r?¶sz3match_previous_expr.<locals>.copy_token_to_repeaterT)r@z(prev) )r0rr4rr)r
Úe2r?r )r>r!Úmatch_previous_expr£s
rGT)ÚuseRegexÚ	asKeyword)ÚstrsÚcaselessÚ	use_regexÚ
as_keywordrHrIrcsF|p|}|o|}t|tƒr.tjr.tjddd|rPdd„}dd„}|rJtnt‰ndd„}dd„}|rhtnt	‰g}t|tƒr„| 
¡}nt|tƒr˜t|ƒ}nt
d	ƒ‚|sªtƒStd
d„|DƒƒrPd}	xŒ|	t|ƒd
krN||	}
xlt||	d
d…ƒD]L\}}|||
ƒr||	|d
=Pqô||
|ƒrô||	|d
=| |	|¡PqôW|	d
7}	qÄW|r$|rbtjnd}
y–tdd„|Dƒƒr˜d d dd„|Dƒ¡¡}nd dd„|Dƒ¡}|r¼d |¡}t||
d d |¡¡}|rúdd„|Dƒ‰| ‡fdd„¡|Stjk
r"tjdddYnXt‡fdd„|Dƒƒ d |¡¡S)a Helper to quickly define a set of alternative :class:`Literal` s,
    and makes sure to do longest-first testing when there is a conflict,
    regardless of the input order, but returns
    a :class:`MatchFirst` for best performance.

    Parameters:

    - ``strs`` - a string of space-delimited literals, or a collection of
      string literals
    - ``caseless`` - treat all literals as caseless - (default= ``False``)
    - ``use_regex`` - as an optimization, will
      generate a :class:`Regex` object; otherwise, will generate
      a :class:`MatchFirst` object (if ``caseless=True`` or ``asKeyword=True``, or if
      creating a :class:`Regex` raises an exception) - (default= ``True``)
    - ``as_keyword`` - enforce :class:`Keyword`-style matching on the
      generated expressions - (default= ``False``)
    - ``asKeyword`` and ``useRegex`` are retained for pre-PEP8 compatibility,
      but will be removed in a future release

    Example::

        comp_oper = one_of("< = > <= >= !=")
        var = Word(alphas)
        number = Word(nums)
        term = var | number
        comparison_expr = term + comp_oper + term
        print(comparison_expr.search_string("B = 12  AA=23 B<=AA AA>12"))

    prints::

        [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']]
    z`More than one string argument passed to one_of, pass choices as a list or space-delimited stringé)Ú
stacklevelcSs| ¡| ¡kS)N)Úupper)ÚaÚbr r r!r-ür.zone_of.<locals>.<lambda>cSs| ¡ | ¡¡S)N)rPÚ
startswith)rQrRr r r!r-ýr.cSs||kS)Nr )rQrRr r r!r-r.cSs
| |¡S)N)rS)rQrRr r r!r-r.z7Invalid argument to one_of, expected string or iterablecss|]}t|ƒdkVqdS)rN)r:)r7Úsymr r r!r9szone_of.<locals>.<genexpr>rrNcss|]}t|ƒdkVqdS)rN)r:)r7rTr r r!r9#sz[{}]rcss|]}t|ƒVqdS)N)r)r7rTr r r!r9&sú|css|]}t |¡VqdS)N)ÚreÚescape)r7rTr r r!r9)sz
\b(?:{})\b)Úflagsz | cSsi|]}|| ¡“qSr )Úlower)r7rTr r r!ú
<dictcomp>4szone_of.<locals>.<dictcomp>csˆ|d ¡S)Nr)rY)r&r'r()Ú
symbol_mapr r!r-5r.z8Exception creating Regex for one_of, building MatchFirstc3s|]}ˆ|ƒVqdS)Nr )r7rT)ÚparseElementClassr r!r9?s)rrrÚ%warn_on_multiple_string_args_to_oneofÚwarningsÚwarnÚCaselessKeywordÚCaselessLiteralÚKeywordr6ÚsplitÚIterableÚlistÚ	TypeErrorÚNoMatchÚanyr:Ú	enumerateÚinsertrVÚ
IGNORECASEÚallrÚjoinÚRegexrr4Ú
sre_constantsÚerrorÚ
MatchFirst)rJrKrLrMrHrIÚisequalÚmasksÚsymbolsÚiÚcurÚjÚotherZre_flagsÚpattÚretr )r\r[r!Úone_ofÅsl)






r{)ÚkeyÚvaluercCsttt||ƒƒƒS)aóHelper to easily and clearly define a dictionary by specifying
    the respective patterns for the key and value.  Takes care of
    defining the :class:`Dict`, :class:`ZeroOrMore`, and
    :class:`Group` tokens in the proper order.  The key pattern
    can include delimiting markers or punctuation, as long as they are
    suppressed, thereby leaving the significant key text.  The value
    pattern can include named results, so that the :class:`Dict` results
    can include named token fields.

    Example::

        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join))
        print(OneOrMore(attr_expr).parse_string(text).dump())

        attr_label = label
        attr_value = Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)

        # similar to Dict, but simpler call format
        result = dict_of(attr_label, attr_value).parse_string(text)
        print(result.dump())
        print(result['shape'])
        print(result.shape)  # object attribute access works too
        print(result.as_dict())

    prints::

        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        SQUARE
        {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'}
    )ÚDictÚ	OneOrMoreÚGroup)r|r}r r r!Údict_ofDs%r)ÚasString)r
Ú	as_stringr‚rcCsr|o|}tƒ dd„¡}| ¡}d|_|dƒ||dƒ}|rHdd„}ndd„}| |¡|j|_| tj¡|S)	aHelper to return the original, untokenized text for a given
    expression.  Useful to restore the parsed fields of an HTML start
    tag into the raw tag text itself, or to revert separate tokens with
    intervening whitespace back to the original matching input text. By
    default, returns astring containing the original parsed text.

    If the optional ``as_string`` argument is passed as
    ``False``, then the return value is
    a :class:`ParseResults` containing any results names that
    were originally matched, and a single token containing the original
    matched text from the input string.  So if the expression passed to
    :class:`original_text_for` contains expressions with defined
    results names, you must set ``as_string`` to ``False`` if you
    want to preserve those results name values.

    The ``asString`` pre-PEP8 argument is retained for compatibility,
    but will be removed in a future release.

    Example::

        src = "this is test <b> bold <i>text</i> </b> normal text "
        for tag in ("b", "i"):
            opener, closer = make_html_tags(tag)
            patt = original_text_for(opener + SkipTo(closer) + closer)
            print(patt.search_string(src)[0])

    prints::

        ['<b> bold <i>text</i> </b>']
        ['<i>text</i>']
    cSs|S)Nr )r&Úlocr(r r r!r-r.z#original_text_for.<locals>.<lambda>FÚ_original_startÚ
_original_endcSs||j|j…S)N)r…r†)r&r'r(r r r!r-•r.cSs&|| d¡| d¡…g|dd…<dS)Nr…r†)Úpop)r&r'r(r r r!ÚextractText˜sz&original_text_for.<locals>.extractText)r%r3rÚcallPreparseÚignoreExprsZsuppress_warningZDiagnosticsÚ)warn_ungrouped_named_tokens_in_collection)r
rƒr‚Ú	locMarkerÚendlocMarkerÚ	matchExprrˆr r r!Úoriginal_text_forls"

rcCst|ƒ dd„¡S)zkHelper to undo pyparsing's default grouping of And expressions,
    even if all but one are non-empty.
    cSs|dS)Nrr )r(r r r!r-¥r.zungroup.<locals>.<lambda>)ÚTokenConverterr4)r
r r r!Úungroup¡sr‘cCs4tƒ dd„¡}t|dƒ|dƒ| ¡ ¡dƒƒS)aû
    (DEPRECATED - future code should use the Located class)
    Helper to decorate a returned token with its starting and ending
    locations in the input string.

    This helper adds the following results names:

    - ``locn_start`` - location where matched expression begins
    - ``locn_end`` - location where matched expression ends
    - ``value`` - the actual parsed results

    Be careful if the input text contains ``<TAB>`` characters, you
    may want to call :class:`ParserElement.parseWithTabs`

    Example::

        wd = Word(alphas)
        for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"):
            print(match)

    prints::

        [[0, 'ljsdf', 5]]
        [[8, 'lksdjjf', 15]]
        [[18, 'lkkjj', 23]]
    cSs|S)Nr )ÚssZllr8r r r!r-Ãr.zlocatedExpr.<locals>.<lambda>Ú
locn_startr}Úlocn_end)r%r3r€rÚleaveWhitespace)r
Úlocatorr r r!ÚlocatedExpr¨sr—ú(ú))Ú
ignoreExpr)ÚopenerÚcloserÚcontentÚignore_exprršrcCsº||kr|tƒkr|n|}||kr*tdƒ‚|dkrFt|tƒr>t|tƒr>t|ƒdkrÂt|ƒdkrÂ|dk	rœtt|t||tj	ddƒƒ 
dd„¡}n$t ¡t||tj	ƒ 
dd„¡}nz|dk	rtt|t
|ƒt
|ƒttj	ddƒƒ 
dd„¡}n4ttt
|ƒt
|ƒttj	ddƒƒ 
d	d„¡}ntd
ƒ‚tƒ}|dk	r€|tt|ƒt||B|Bƒt|ƒƒK}n$|tt|ƒt||Bƒt|ƒƒK}| d||f¡|S)a&
Helper method for defining nested lists enclosed in opening and
    closing delimiters (``"("`` and ``")"`` are the default).

    Parameters:
    - ``opener`` - opening character for a nested list
      (default= ``"("``); can also be a pyparsing expression
    - ``closer`` - closing character for a nested list
      (default= ``")"``); can also be a pyparsing expression
    - ``content`` - expression for items within the nested lists
      (default= ``None``)
    - ``ignore_expr`` - expression for ignoring opening and closing delimiters
      (default= :class:`quoted_string`)
    - ``ignoreExpr`` - this pre-PEP8 argument is retained for compatibility
      but will be removed in a future release

    If an expression is not provided for the content argument, the
    nested expression will capture all whitespace-delimited content
    between delimiters as a list of separate values.

    Use the ``ignore_expr`` argument to define expressions that may
    contain opening or closing characters that should not be treated as
    opening or closing characters for nesting, such as quoted_string or
    a comment expression.  Specify multiple expressions using an
    :class:`Or` or :class:`MatchFirst`. The default is
    :class:`quoted_string`, but if no expressions are to be ignored, then
    pass ``None`` for this argument.

    Example::

        data_type = one_of("void int short long char float double")
        decl_data_type = Combine(data_type + Opt(Word('*')))
        ident = Word(alphas+'_', alphanums+'_')
        number = pyparsing_common.number
        arg = Group(decl_data_type + ident)
        LPAR, RPAR = map(Suppress, "()")

        code_body = nested_expr('{', '}', ignore_expr=(quoted_string | c_style_comment))

        c_function = (decl_data_type("type")
                      + ident("name")
                      + LPAR + Opt(delimited_list(arg), [])("args") + RPAR
                      + code_body("body"))
        c_function.ignore(c_style_comment)

        source_code = '''
            int is_odd(int x) {
                return (x%2);
            }

            int dec_to_hex(char hchar) {
                if (hchar >= '0' && hchar <= '9') {
                    return (ord(hchar)-ord('0'));
                } else {
                    return (10+ord(hchar)-ord('A'));
                }
            }
        '''
        for func in c_function.search_string(source_code):
            print("%(name)s (%(type)s) args: %(args)s" % func)


    prints::

        is_odd (int) args: [['int', 'x']]
        dec_to_hex (int) args: [['char', 'hchar']]
    z.opening and closing strings cannot be the sameNr)ÚexactcSs|d ¡S)Nr)Ústrip)r(r r r!r-%r.znested_expr.<locals>.<lambda>cSs|d ¡S)Nr)r )r(r r r!r-)r.cSs|d ¡S)Nr)r )r(r r r!r-3r.cSs|d ¡S)Nr)r )r(r r r!r-;r.zOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)Ú
quoted_stringrrrr:rrÚ
CharsNotInrÚDEFAULT_WHITE_CHARSr3Úemptyrr6r0r€rÚ
ZeroOrMorer)r›rœrržršrzr r r!Únested_exprËsHJ

,&
&$r¦ú<ú>cs‚t|tƒr|‰t||d}n|j‰tttdƒ}|rŽt ¡ 	t
¡}||dƒttt
|tdƒ|ƒƒƒtddgddƒ 	d	d
„¡|}npt ¡ 	t
¡ttddB}||dƒttt
| 	d
d
„¡ttdƒ|ƒƒƒƒtddgddƒ 	dd
„¡|}ttdƒ|ddd}| dˆ¡| ‡fdd
„¡|dd ˆ dd¡ ¡ ¡¡ƒ dˆ¡}ˆ|_ˆ|_t|ƒƒ|_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag name)rKz_-:Útagú=ú/F)Údefaultr¤cSs|ddkS)Nrr«r )r&r'r(r r r!r-[r.z_makeTags.<locals>.<lambda>r¨)Z
exclude_charscSs|d ¡S)Nr)rY)r(r r r!r-ir.cSs|ddkS)Nrr«r )r&r'r(r r r!r-or.z</)Úadjacentz<%s>c	s*| dd ˆ dd¡ ¡ ¡¡| ¡¡S)NÚstartrú:ú )Ú__setitem__rmÚreplaceÚtitlercr)r()Úresnamer r!r-xsrrr¯r°z</%s>)rrrbÚnamer1ÚalphasÚ	alphanumsZdbl_quoted_stringrr3Z
remove_quotesr~r¥r€rrr¡Ú
printablesrr6rr4rmr²r³rcr©ÚSkipToÚtag_body)ÚtagStrÚxmlÚsuppress_LTÚsuppress_GTÚtagAttrNameÚtagAttrValueÚopenTagÚcloseTagr )r´r!Ú	_makeTagsKs,
JV 
rÃ)Útag_strrcCs
t|dƒS)aPHelper to construct opening and closing tag expressions for HTML,
    given a tag name. Matches tags in either upper or lower case,
    attributes with namespaces and with quoted or unquoted values.

    Example::

        text = '<td>More info at the <a href="https://github.com/pyparsing/pyparsing/wiki">pyparsing</a> wiki page</td>'
        # make_html_tags returns pyparsing expressions for the opening and
        # closing tags as a 2-tuple
        a, a_end = make_html_tags("A")
        link_expr = a + SkipTo(a_end)("link_text") + a_end

        for link in link_expr.search_string(text):
            # attributes in the <A> tag (like "href" shown here) are
            # also accessible as named results
            print(link.link_text, '->', link.href)

    prints::

        pyparsing -> https://github.com/pyparsing/pyparsing/wiki
    F)rÃ)rÄr r r!Úmake_html_tags…srÅcCs
t|dƒS)z½Helper to construct opening and closing tag expressions for XML,
    given a tag name. Matches tags only in the given upper/lower case.

    Example: similar to :class:`make_html_tags`
    T)rÃ)rÄr r r!Ú
make_xml_tags srÆz_:zany tagcCsi|]\}}|| d¡“qS)ú;)Úrstrip)r7ÚkÚvr r r!rZ¯srZz&(?P<entity>rUz);zcommon HTML entitycCst |j¡S)zRHelper parser action to replace common HTML entities with their special characters)Ú_htmlEntityMapÚgetÚentity)r(r r r!Úreplace_html_entityµsrÎc@seZdZdZdZdS)ÚOpAssocrrNN)Ú__name__Ú
__module__Ú__qualname__ÚLEFTÚRIGHTr r r r!rϺsrÏ)Ú	base_exprÚop_listÚlparÚrparrcCsüGdd„dtƒ}d|_tƒ}t|ƒ}t|ƒ}||||B}x°t|ƒD]¢\}}|ddd…\}	}
}}t|	tƒr~t |	¡}	|
dkr¾t|	t	t
fƒr t|	ƒdkr¨td	ƒ‚|	\}
}d
 
|
|¡}n
d 
|	¡}d|
krÜdksæntd
ƒ‚|tjtjfkrþtdƒ‚tƒ |¡}|tjkrÒ|
dkr>|||	ƒt||	dƒ}n’|
dkr’|	dk	rx|||	|ƒt||	|dƒ}n|||ƒt|dƒ}n>|
dkrª|||
|||ƒt|t|
|||ƒƒ}nØ|tjkrª|
dkrt|	tƒsüt|	ƒ}	||	j|ƒt|	|ƒ}n’|
dkrp|	dk	rR|||	|ƒt||	|dƒ}n|||ƒt||dƒ}n:|
dkrª|||
|||ƒt||
|||ƒ}|rÖt|t	t
fƒrÌ|j|Žn
| |¡|||B |¡K}|}qHW||K}|S)a¶
Helper method for constructing grammars of expressions made up of
    operators working in a precedence hierarchy.  Operators may be unary
    or binary, left- or right-associative.  Parse actions can also be
    attached to operator expressions. The generated parser will also
    recognize the use of parentheses to override operator precedences
    (see example below).

    Note: if you define a deep operator list, you may see performance
    issues when using infix_notation. See
    :class:`ParserElement.enable_packrat` for a mechanism to potentially
    improve your parser performance.

    Parameters:
    - ``base_expr`` - expression representing the most basic operand to
      be used in the expression
    - ``op_list`` - list of tuples, one for each operator precedence level
      in the expression grammar; each tuple is of the form ``(op_expr,
      num_operands, right_left_assoc, (optional)parse_action)``, where:

      - ``op_expr`` is the pyparsing expression for the operator; may also
        be a string, which will be converted to a Literal; if ``num_operands``
        is 3, ``op_expr`` is a tuple of two expressions, for the two
        operators separating the 3 terms
      - ``num_operands`` is the number of terms for this operator (must be 1,
        2, or 3)
      - ``right_left_assoc`` is the indicator whether the operator is right
        or left associative, using the pyparsing-defined constants
        ``OpAssoc.RIGHT`` and ``OpAssoc.LEFT``.
      - ``parse_action`` is the parse action to be associated with
        expressions matching this operator expression (the parse action
        tuple member may be omitted); if the parse action is passed
        a tuple or list of functions, this is equivalent to calling
        ``set_parse_action(*fn)``
        (:class:`ParserElement.set_parse_action`)
    - ``lpar`` - expression for matching left-parentheses
      (default= ``Suppress('(')``)
    - ``rpar`` - expression for matching right-parentheses
      (default= ``Suppress(')')``)

    Example::

        # simple example of four-function arithmetic with ints and
        # variable names
        integer = pyparsing_common.signed_integer
        varname = pyparsing_common.identifier

        arith_expr = infix_notation(integer | varname,
            [
            ('-', 1, OpAssoc.RIGHT),
            (one_of('* /'), 2, OpAssoc.LEFT),
            (one_of('+ -'), 2, OpAssoc.LEFT),
            ])

        arith_expr.run_tests('''
            5+3*6
            (5+3)*6
            -2--11
            ''', full_dump=False)

    prints::

        5+3*6
        [[5, '+', [3, '*', 6]]]

        (5+3)*6
        [[[5, '+', 3], '*', 6]]

        -2--11
        [[['-', 2], '-', ['-', 11]]]
    c@seZdZddd„ZdS)zinfix_notation.<locals>._FBTcSs|j ||¡|gfS)N)r
Z	try_parse)ÚselfÚinstringr„Ú	doActionsr r r!Ú	parseImplsz%infix_notation.<locals>._FB.parseImplN)T)rÐrÑrÒrÜr r r r!Ú_FBsrÝzFollowedBy>)NNéérNz@if numterms=3, opExpr must be a tuple or list of two expressionsz	{}{} termz{} termrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)r.)rN.)Ú
FollowedByrÐr0rrirrrrÚtuplerer:rrrÏrÓrÔrr€rrr
r3ÚsetName)rÕrÖr×rØrÝrzÚlastExprruÚoperDefÚopExprÚarityÚrightLeftAssocÚpaÚopExpr1ÚopExpr2Z	term_nameÚthisExprrŽr r r!Úinfix_notationÑsrM






 




rìcs0ˆ ˆdd…¡‡‡fdd„‰‡fdd„}‡fdd„}‡fdd	„}ttƒ d
¡ ¡ƒ}tƒtƒ |¡ d¡}tƒ |¡ d¡}	tƒ |¡ d
¡}
|rÆtt	|ƒ|t|	t|ƒt	|ƒƒ|
ƒ}n,tt	|ƒt|	t|ƒt	|ƒƒt	|
ƒƒ}| 
‡fdd„¡| ‡fdd„¡| t
tƒ¡| d¡S)a”	
    (DEPRECATED - use IndentedBlock class instead)
    Helper method for defining space-delimited indentation blocks,
    such as those used to define block statements in Python source code.

    Parameters:

    - ``blockStatementExpr`` - expression defining syntax of statement that
      is repeated within the indented block
    - ``indentStack`` - list created by caller to manage indentation stack
      (multiple ``statementWithIndentedBlock`` expressions within a single
      grammar should share a common ``indentStack``)
    - ``indent`` - boolean indicating whether block must be indented beyond
      the current level; set to ``False`` for block of left-most statements
      (default= ``True``)

    A valid block must contain at least one ``blockStatement``.

    (Note that indentedBlock uses internal parse actions which make it
    incompatible with packrat parsing.)

    Example::

        data = '''
        def A(z):
          A1
          B = 100
          G = A2
          A2
          A3
        B
        def BB(a,b,c):
          BB1
          def BBA():
            bba1
            bba2
            bba3
        C
        D
        def spam(x,y):
             def eggs(z):
                 pass
        '''


        indentStack = [1]
        stmt = Forward()

        identifier = Word(alphas, alphanums)
        funcDecl = ("def" + identifier + Group("(" + Opt(delimitedList(identifier)) + ")") + ":")
        func_body = indentedBlock(stmt, indentStack)
        funcDef = Group(funcDecl + func_body)

        rvalue = Forward()
        funcCall = Group(identifier + "(" + Opt(delimitedList(rvalue)) + ")")
        rvalue << (funcCall | identifier | Word(nums))
        assignment = Group(identifier + "=" + rvalue)
        stmt << (funcDef | assignment | identifier)

        module_body = OneOrMore(stmt)

        parseTree = module_body.parseString(data)
        parseTree.pprint()

    prints::

        [['def',
          'A',
          ['(', 'z', ')'],
          ':',
          [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]],
         'B',
         ['def',
          'BB',
          ['(', 'a', 'b', 'c', ')'],
          ':',
          [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]],
         'C',
         'D',
         ['def',
          'spam',
          ['(', 'x', 'y', ')'],
          ':',
          [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]]
    Ncsˆdˆdd…<dS)Néÿÿÿÿr r )Ú
backup_stacksÚindentStackr r!Úreset_stackÂsz"indentedBlock.<locals>.reset_stackcsN|t|ƒkrdSt||ƒ}|ˆdkrJ|ˆdkr>t||dƒ‚t||dƒ‚dS)Nrízillegal nestingznot a peer entry)r:ÚcolrB)r&r'r(ÚcurCol)rïr r!ÚcheckPeerIndentÅs
z&indentedBlock.<locals>.checkPeerIndentcs2t||ƒ}|ˆdkr"ˆ |¡nt||dƒ‚dS)Nríznot a subentry)rñÚappendrB)r&r'r(rò)rïr r!ÚcheckSubIndentÎs
z%indentedBlock.<locals>.checkSubIndentcsJ|t|ƒkrdSt||ƒ}ˆr&|ˆks2t||dƒ‚|ˆdkrFˆ ¡dS)Nznot an unindentrí)r:rñrBr‡)r&r'r(rò)rïr r!Ú
checkUnindentÕs
z$indentedBlock.<locals>.checkUnindentz	 ÚINDENTrÚUNINDENTcsˆrˆ d¡odSdS)Nrí)r‡r )rîr r!r-òr.zindentedBlock.<locals>.<lambda>csˆƒS)Nr )rQrRÚcÚd)rðr r!r-ôr.zindented block)rôrÚLineEndZset_whitespace_charsÚsuppressr%r3rr€rr4Zset_fail_actionÚignorer)ÚblockStatementExprrïÚindentrîrórõröÚNLr÷ÚPEERÚUNDENTÚsmExprr )rîrïrðr!Ú
indentedBlockjs&V		,*rz/\*(?:[^*]|\*(?!/))*z*/zC style commentz<!--[\s\S]*?-->zHTML commentz.*zrest of linez//(?:\\\n|[^\n])*z
// commentzC++ style commentz#.*zPython style commentcCsg|]}t|tƒr|‘qSr )rr)r7rÊr r r!ú
<listcomp>sr)rFNN)N)FTF)T)ZÚ
html.entitiesÚhtmlrVrrÚcoreÚutilrrrÚUnionrrÚboolZOptionalTyper,r"r5rArGZIterableTyper{rrr‘r—r¡r¦rrÃÚTuplerÅrÆr1r¶r·rZany_open_tagZ
any_close_tagÚentitiesÚhtml5ÚitemsrËrnrmZcommon_html_entityrÎÚEnumrÏZInfixNotationOperatorArgTypeZParseActionZInfixNotationOperatorSpecÚListrìrrZc_style_commentZhtml_commentZleave_whitespaceZrest_of_lineZdbl_slash_commentZcpp_style_commentZjava_style_commentZpython_style_commentÚvarsÚvaluesZ_builtin_exprsÚ
delimitedListÚcountedArrayÚmatchPreviousLiteralÚmatchPreviousExprÚoneOfÚdictOfÚoriginalTextForÚ
nestedExprÚmakeHTMLTagsÚmakeXMLTagsÚ
anyOpenTagÚanyCloseTagÚcommonHTMLEntityÚreplaceHTMLEntityÚopAssocÚ
infixNotationÚ
cStyleCommentÚhtmlCommentÚ
restOfLineÚdblSlashCommentÚcppStyleCommentÚjavaStyleCommentÚpythonStyleCommentr r r r!Ú<module>s¾*37!$w)3$&y;

	$
$