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

6ǫz9w`ã@sÒddlZddlZddlmZddlmZmZmZmZddl	m
ZGdd„dejej
ejejejƒZeejƒZe ded	¡ZGd
d„deƒZGdd
„d
eƒZGdd„deƒZGdd„deƒZGdd„deƒZdS)éN)ÚOptionalé)ÚcolÚlineÚlinenoÚ_collapse_string_to_ranges)Úpyparsing_unicodec@seZdZdS)ÚExceptionWordUnicodeN)Ú__name__Ú
__module__Ú__qualname__©r
r
ú“/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/pyparsing/exceptions.pyr	sr	z([z
]{1,16})|.c@sÌeZdZdZd eeeedœdd„Zed!dd	„ƒZ	e
d
d„ƒZeedœd
d„ƒZ
eedœdd„ƒZeedœdd„ƒZeedœdd„ƒZedœdd„Zdd„Zd"ddœeedœdd„Zd#edœdd„ZeZdS)$ÚParseBaseExceptionz7base exception class for all parsing runtime exceptionsrN)ÚpstrÚlocÚmsgcCsD||_|dkr||_d|_n||_||_||_|_|||f|_dS)NÚ)rrrZparser_elementÚ
parserElementÚargs)ÚselfrrrÚelemr
r
rÚ__init__szParseBaseException.__init__éc
Cs„ddl}ddlm}|dkr$t ¡}g}t|tƒrV| |j¡| d|j	dd¡| d 
t|ƒj|¡¡|dkrz|j
|j|d}tƒ}xêt||d…ƒD]Ô\}}|d}	|	j d	d¡}
t|
|ƒr|	jjd
krÚq¢t|
ƒ|krèq¢| t|
ƒ¡t|
ƒ}| d 
|j|j|
¡¡nP|
dk	rBt|
ƒ}| d 
|j|j¡¡n&|	j}|jd
krVq¢| d 
|j¡¡|d8}|s¢Pq¢Wd |¡S)aì
        Method to take an exception and translate the Python internal traceback into a list
        of the pyparsing expressions that caused the exception to be raised.

        Parameters:

        - exc - exception raised during parsing (need not be a ParseException, in support
          of Python exceptions that might be raised in a parse action)
        - depth (default=16) - number of levels back in the stack trace to list expression
          and function names; if None, the full stack trace names will be listed; if 0, only
          the failing input line, marker, and exception string will be shown

        Returns a multi-line string listing the ParserElements and/or function names in the
        exception's stack trace.
        rNr)Ú
ParserElementú ú^z{}: {})Úcontextr)Ú	parseImplÚ
_parseNoCachez
{}.{} - {}z{}.{})Úwrapperz<module>z{}Ú
)ÚinspectÚcorerÚsysÚgetrecursionlimitÚ
isinstancerÚappendrÚcolumnÚformatÚtyper
ÚgetinnerframesÚ
__traceback__ÚsetÚ	enumerateÚf_localsÚgetÚf_codeÚco_nameÚidÚaddrÚjoin)
ÚexcÚdepthr"rÚretÚcallersÚseenÚiÚffÚfrmÚf_selfÚ	self_typeÚcoder
r
rÚexplain_exception)sH


z$ParseBaseException.explain_exceptioncCs||j|j|j|jƒS)z¬
        internal factory method to simplify creating one type of ParseException
        from another - avoids having __init__ signature conflicts among subclasses
        )rrrr)ÚclsÚper
r
rÚ_from_exceptionksz"ParseBaseException._from_exception)ÚreturncCst|j|jƒS)zG
        Return the line of text where the exception occurred.
        )rrr)rr
r
rrsszParseBaseException.linecCst|j|jƒS)zV
        Return the 1-based line number of text where the exception occurred.
        )rrr)rr
r
rrzszParseBaseException.linenocCst|j|jƒS)z]
        Return the 1-based column on the line of text where the exception occurred.
        )rrr)rr
r
rrszParseBaseException.colcCst|j|jƒS)z]
        Return the 1-based column on the line of text where the exception occurred.
        )rrr)rr
r
rr(ˆszParseBaseException.columncCs†|jrh|jt|jƒkrd}qlt |j|j¡}|dk	r@| d¡}n|j|j|jd…}d| dd¡}nd}d |j||j|j	|j
¡S)	Nz, found end of textrrz
, found %rz\\ú\rz%{}{}  (at char {}), (line:{}, col:{}))rrÚlenÚ_exception_word_extractorÚmatchÚgroupÚreplacer)rrr()rÚfoundstrZfound_matchÚfoundr
r
rÚ__str__szParseBaseException.__str__cCst|ƒS)N)Ústr)rr
r
rÚ__repr__¡szParseBaseException.__repr__z>!<)ÚmarkerString)Ú
marker_stringrEcCsL|dk	r|n|}|j}|jd}|rDd |d|…|||d…f¡}| ¡S)z‹
        Extracts the exception line from the input string, and marks
        the location of the exception with a special symbol.
        Nrr)rr(r5Ústrip)rrRrQÚline_strÚline_columnr
r
rÚmark_input_line¤s
z"ParseBaseException.mark_input_linecCs| ||¡S)a
        Method to translate the Python internal traceback into a list
        of the pyparsing expressions that caused the exception to be raised.

        Parameters:

        - depth (default=16) - number of levels back in the stack trace to list expression
          and function names; if None, the full stack trace names will be listed; if 0, only
          the failing input line, marker, and exception string will be shown

        Returns a multi-line string listing the ParserElements and/or function names in the
        exception's stack trace.

        Example::

            expr = pp.Word(pp.nums) * 3
            try:
                expr.parse_string("123 456 A789")
            except pp.ParseException as pe:
                print(pe.explain(depth=0))

        prints::

            123 456 A789
                    ^
            ParseException: Expected W:(0-9), found 'A'  (at char 8), (line:1, col:9)

        Note: the diagnostic output will include string representations of the expressions
        that failed to parse. These representations will be more helpful if you use `set_name` to
        give identifiable names to your expressions. Otherwise they will use the default string
        forms, which may be cryptic to read.

        Note: pyparsing's default truncation of exception tracebacks may also truncate the
        stack of expressions that are displayed in the ``explain`` output. To get the full listing
        of parser expressions, you may have to set ``ParserElement.verbose_stacktrace = True``
        )rA)rr7r
r
rÚexplain²s%zParseBaseException.explain)rNN)r)N)r)r
rrÚ__doc__rOÚintrrÚstaticmethodrAÚclassmethodrDÚpropertyrrrr(rNrPrVrWÚ
markInputliner
r
r
rrs(A'rc@seZdZdZdS)ÚParseExceptionaq
    Exception thrown when a parse expression doesn't match the input string

    Example::

        try:
            Word(nums).set_name("integer").parse_string("ABC")
        except ParseException as pe:
            print(pe)
            print("column: {}".format(pe.column))

    prints::

       Expected integer (at char 0), (line:1, col:1)
        column: 1

    N)r
rrrXr
r
r
rr^Üsr^c@seZdZdZdS)ÚParseFatalExceptionzu
    User-throwable exception thrown when inconsistent parse content
    is found; stops all parsing immediately
    N)r
rrrXr
r
r
rr_ðsr_c@seZdZdZdS)ÚParseSyntaxExceptionzó
    Just like :class:`ParseFatalException`, but thrown internally
    when an :class:`ErrorStop<And._ErrorStop>` ('-' operator) indicates
    that parsing is to stop immediately because an unbacktrackable
    syntax error has been found.
    N)r
rrrXr
r
r
rr`÷sr`c@s&eZdZdZdd„Zedœdd„ZdS)ÚRecursiveGrammarExceptionzî
    Exception thrown by :class:`ParserElement.validate` if the
    grammar could be left-recursive; parser may need to enable
    left recursion using :class:`ParserElement.enable_left_recursion<ParserElement.enable_left_recursion>`
    cCs
||_dS)N)ÚparseElementTrace)rÚparseElementListr
r
rrsz"RecursiveGrammarException.__init__)rEcCsd |j¡S)NzRecursiveGrammarException: {})r)rb)rr
r
rrN
sz!RecursiveGrammarException.__str__N)r
rrrXrrOrNr
r
r
rrasra)Úrer$ÚtypingrÚutilrrrrÚunicoderZppuÚLatin1ÚLatinAÚLatinBÚGreekÚCyrillicr	Ú	alphanumsZ_extract_alphanumsÚcompilerHÚ	Exceptionrr^r_r`rar
r
r
rÚ<module>s"
J