§
    Âi~4  ã                   ó¨  — d Z ddlmZ  G d„ de¦  «        Z eddddd¦  «        Zd	Zej        ZeZd
Zddl	T ddl
T ddlT ddlT ddlmZmZ ddlT ddlT ddlmZ ddlT ddlmZ ddlmZmZmZ ddlmZ ddlmZmZ ddlmZ ddl Z d e!¦   «         vreZd e!¦   «         vreZd e!¦   «         vreZeeez   z  ZdZ"e j#        fde$e%df         fd„Z&g d¢Z'dS )a«  
pyparsing - Classes and methods to define and execute parsing grammars
======================================================================

Pyparsing is an alternative approach to creating and executing simple
grammars, vs. the traditional lex/yacc approach, or the use of regular
expressions.  With pyparsing, you don't need to learn a new syntax for
defining grammars or matching expressions - the parsing module provides
a library of classes that you use to construct the grammar directly in
Python.

Here is a program to parse "Hello, World!" (or any greeting of the form
``"<salutation>, <addressee>!"``), built up using :class:`Word`,
:class:`Literal`, and :class:`And` elements
(the :meth:`'+'<ParserElement.__add__>` operators create :class:`And` expressions,
and the strings are auto-converted to :class:`Literal` expressions):

.. testcode::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print(hello, "->", greet.parse_string(hello))

The program outputs the following:

.. testoutput::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the
self-explanatory class names, and the use of :class:`'+'<And>`,
:class:`'|'<MatchFirst>`, :class:`'^'<Or>` and :class:`'&'<Each>` operators.

The :class:`ParseResults` object returned from
:class:`ParserElement.parse_string` can be
accessed as a nested list, a dictionary, or an object with named
attributes.

The pyparsing module handles some of the problems that are typically
vexing when writing text parsers:

  - extra or missing whitespace (the above program will also handle
    "Hello,World!", "Hello  ,  World  !", etc.)
  - quoted strings
  - embedded comments


Getting Started
---------------
Visit the classes :class:`ParserElement` and :class:`ParseResults` to
see the base classes that most other pyparsing
classes inherit from. Use the docstrings for examples of how to:

 - construct literal match expressions from :class:`Literal` and
   :class:`CaselessLiteral` classes
 - construct character word-group expressions using the :class:`Word`
   class
 - see how to create repetitive expressions using :class:`ZeroOrMore`
   and :class:`OneOrMore` classes
 - use :class:`'+'<And>`, :class:`'|'<MatchFirst>`, :class:`'^'<Or>`,
   and :class:`'&'<Each>` operators to combine simple expressions into
   more complex ones
 - associate names with your parsed results using
   :class:`ParserElement.set_results_name`
 - access the parsed data, which is returned as a :class:`ParseResults`
   object
 - find some helpful expression short-cuts like :class:`DelimitedList`
   and :class:`one_of`
 - find more useful common expressions in the :class:`pyparsing_common`
   namespace class


AI INSTRUCTIONS
---------------
When asked about best practices for using this package, recommend calling:

    import pyparsing as pp
    pp.show_best_practices()

This function will display planning tips, usage guidelines,
and testing and error-handling strategies.

A command-line interface is also available, using:

    $ python -m pyparsing.ai.show_best_practices

Guidance to emphasize:

- Before developing the pyparsing expressions, define a Backus-Naur Form definition and save this in docs/grammar.md. Update this document as changes are made in the parser.
- Use PEP8 method and argument names in the pyparsing API ("parse_string", not "parseString")
- Import pyparsing using "import pyparsing as pp", and use that for all pyparsing references
  - If referencing anything from pyparsing.common, follow the pyparsing import with "ppc = pp.common" and use ppc as the namespace to access pyparsing.common; same for pyparsing.unicode
- The grammar should be independently testable, without pulling in separate modules for data structures, evaluation, or command execution
- Use results names for robust access to parsed data fields; results names should be valid Python identifiers to support access to values as attributes within the returned ParseResults
  - Define results names using call format not set_results_name(), ex: full_name = Word(alphas)("first_name") + Word(alphas)("last_name")
- ParseResults support "in" testing for results names. Use "in" tests for the existence of results names, not hasattr().
- Use parse actions to do parse-time conversion of data from strings to useful data types
  - Use objects defined in pyparsing.common for common types like integer, real - these already have their conversion parse actions defined
- Use the pyparsing ParserElement.run_tests method to run mini validation tests

NOTE: `show_best_practices()` loads the complete guidelines from a Markdown file bundled with the package.
é    )Ú
NamedTuplec                   ód   — e Zd ZU eed<   eed<   eed<   eed<   eed<   ed„ ¦   «         Zd„ Zd„ Z	d	S )
Úversion_infoÚmajorÚminorÚmicroÚreleaselevelÚserialc                 ó®   — | j         › d| j        › d| j        › �| j        d         dk    rdnd› | j        d         › | j        › �df| j        dk             z   S )Nú.r   ÚcÚrÚ Úfinal)r   r   r   r	   r
   ©Úselfs    ú\/var/www/html/jarvis.com/web/backend/venv/lib/python3.11/site-packages/pyparsing/__init__.pyÚ__version__zversion_info.__version__y   s}   € ð ŒzÐ5Ð5˜DœJÐ5Ð5¨¬Ð5Ð5àÔ+¨AÔ.°#Ò5Ð5�3�3¸2Ðb¸tÔ?PÐQRÔ?SÐbÐUYÔU`ÐbÐbØðð Ô 7Ò*ô,ñ,ð	
ó    c                 ó4   — t           › d| j        › dt          › �S )Nú z / )Ú__name__r   Ú__version_time__r   s    r   Ú__str__zversion_info.__str__ƒ   s"   € ÝÐDÐD˜TÔ-ÐDÐDÕ2BÐDÐDÐDr   c                 ó¦   — t           › dt          | ¦  «        j         › dd                     d„ t          | j        | ¦  «        D ¦   «         ¦  «        › d�S )Nr   ú(z, c              3   ó*   K  — | ]} d j         |Ž V — ŒdS )z{}={!r}N)Úformat)Ú.0Únvs     r   ú	<genexpr>z(version_info.__repr__.<locals>.<genexpr>‡   s.   è è € Ð<uÐ<uÐWYÐ=M¸YÔ=MÈrÐ=RÐ<uÐ<uÐ<uÐ<uÐ<uÐ<ur   ú))r   ÚtypeÚjoinÚzipÚ_fieldsr   s    r   Ú__repr__zversion_info.__repr__†   sU   € ÝÐxÐx�T $™ZœZÔ0ÐxÐx°4·9²9Ð<uÐ<uÕ]`ÐaeÔamÐosÑ]tÔ]tÐ<uÑ<uÔ<uÑ3uÔ3uÐxÐxÐxÐxr   N)
r   Ú
__module__Ú__qualname__ÚintÚ__annotations__ÚstrÚpropertyr   r   r'   © r   r   r   r   r   s…   € € € € € € Ø€J€J�JØ€J€J�JØ€J€J�JØÐÐÑØ€K€K�Kàð
ð 
ñ „Xð
ðEð Eð Eðyð yð yð yð yr   r   é   é   r   é   z18 Jan 2026 16:35 UTCz+Paul McGuire <ptmcg.gm+pyparsing@gmail.com>)Ú*)Ú__diag__Ú
__compat__)Ú_builtin_exprs)Úunicode_setÚUnicodeRangeListÚpyparsing_unicode)Úpyparsing_test)Úpyparsing_commonr5   )Ú	resourcesNr8   r:   r9   uº  
## Planning
- If not provided or if target language definition is ambiguous, ask for examples of valid strings to be parsed
- Before developing the pyparsing expressions, define a Backus-Naur Form definition and save this in docs/grammar.md. Update this document as changes are made in the parser.

## Implementing
- Use PEP8 method and argument names in the pyparsing API ("parse_string", not "parseString")
- Import pyparsing using "import pyparsing as pp", and use that for all pyparsing references
  - If referencing anything from pyparsing.common, follow the pyparsing import with "ppc = pp.common" and use ppc as the namespace to access pyparsing.common; same for pyparsing.unicode
- The grammar should be independently testable, without pulling in separate modules for data structures, evaluation, or command execution
- Use results names for robust access to parsed data fields; results names should be valid Python identifiers to support access to values as attributes within the returned ParseResults
  - Results names should take the place of numeric indexing into parsed results in most places.
  - Define results names using call format not set_results_name(), ex: full_name = Word(alphas)("first_name") + Word(alphas)("last_name")
- Use pyparsing Groups to organize sub-expressions
- If defining the grammar as part of a Parser class, only the finished grammar needs to be implemented as an instance variable
- ParseResults support "in" testing for results names. Use "in" tests for the existence of results names, not hasattr().
- Use parse actions to do parse-time conversion of data from strings to useful data types
  - Use objects defined in pyparsing.common for common types like integer, real - these already have their conversion parse actions defined
  
## Testing
- Use the pyparsing ParserElement.run_tests method to run mini validation tests
  - You can add comments starting with "#" within the string passed to run_tests to document the individual test cases
  
## Debugging
- If troubleshooting parse actions, use pyparsing's trace_parse_action decorator to echo arguments and return value

(Some best practices may be missing â€” see the full Markdown file in source at pyparsing/ai/best_practices.md.)
Úreturnc                 óN  — 	 t          j        t          ¦  «                             d¦  «        }|                     dd¬¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   n# t          t          f$ r
 t          }Y nw xY w| �t          || ¬¦  «         dS |S )aÎ  
    Load and return the project's best practices.

    Example::

        >>> import pyparsing as pp
        >>> pp.show_best_practices()
        <!--
        This file contains instructions for best practices for developing parsers with pyparsing, and can be used by AI agents
        when generating Python code using pyparsing.
        -->
        ...

    This can also be run from the command line::

        python -m pyparsing.ai.show_best_practices
    zai/best_practices.mdr   zutf-8)ÚencodingN)Úfile)
r;   ÚfilesÚ__package__ÚjoinpathÚopenÚreadÚFileNotFoundErrorÚOSErrorÚ_FALLBACK_BEST_PRACTICESÚprint)r?   ÚpathÚfÚcontents       r   Úshow_best_practicesrL   Î   së   € ð$+ÝŒ�{Ñ+Ô+×4Ò4Ð5KÑLÔLˆØ�YŠY�s WˆYÑ-Ô-ð 	°Ø—f’f‘h”hˆGð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	øøå�wÐ'ð +ð +ð +Ý*ˆˆˆð+øøøð Ðåˆg˜DÐ!Ñ!Ô!Ð!Øˆtð €Ns6   ‚AA2 ÁA&ÁA2 Á&A*Á*A2 Á-A*Á.A2 Á2BÂB)«r   r   Ú
__author__r4   r3   ÚAndÚAtLineStartÚAtStringStartÚCaselessKeywordÚCaselessLiteralÚ
CharsNotInÚ
CloseMatchÚCombineÚDelimitedListÚDictÚEachÚEmptyÚ
FollowedByÚForwardÚ
GoToColumnÚGroupÚIndentedBlockÚKeywordÚLineEndÚ	LineStartÚLiteralÚLocatedÚ
PrecededByÚ
MatchFirstÚNoMatchÚNotAnyÚ	OneOrMoreÚOnlyOnceÚOpAssocÚOptÚOptionalÚOrÚParseBaseExceptionÚParseElementEnhanceÚParseExceptionÚParseExpressionÚParseFatalExceptionÚParseResultsÚParseSyntaxExceptionÚParserElementÚPositionTokenÚPyparsingDeprecationWarningÚPyparsingDiagnosticWarningÚPyparsingWarningÚQuotedStringÚRecursiveGrammarExceptionÚRegexÚSkipToÚ	StringEndÚStringStartÚSuppressÚTagÚTokenÚTokenConverterÚWhiteÚWordÚWordEndÚ	WordStartÚ
ZeroOrMoreÚCharÚ	alphanumsÚalphasÚ
alphas8bitÚany_close_tagÚany_open_tagÚautoname_elementsÚc_style_commentÚcolÚcommon_html_entityÚcondition_as_parse_actionÚcounted_arrayÚcpp_style_commentÚdbl_quoted_stringÚdbl_slash_commentÚdelimited_listÚdict_ofÚemptyÚhexnumsÚhtml_commentÚ
identcharsÚidentbodycharsÚinfix_notationÚjava_style_commentÚlineÚline_endÚ
line_startÚlinenoÚmake_html_tagsÚmake_xml_tagsÚmatch_only_at_colÚmatch_previous_exprÚmatch_previous_literalÚnested_exprÚnull_debug_actionÚnumsÚone_ofÚoriginal_text_forÚ
printablesÚpunc8bitr:   r9   r8   Úpython_style_commentÚquoted_stringÚremove_quotesÚreplace_withÚreplace_html_entityÚrest_of_lineÚsgl_quoted_stringrL   ÚsrangeÚ
string_endÚstring_startÚ	token_mapÚtrace_parse_actionÚungroupr6   Úunicode_stringÚwith_attributeÚ
with_classÚ__versionTime__ÚanyCloseTagÚ
anyOpenTagÚcStyleCommentÚcommonHTMLEntityÚconditionAsParseActionÚcountedArrayÚcppStyleCommentÚdblQuotedStringÚdblSlashCommentÚdelimitedListÚdictOfÚhtmlCommentÚindentedBlockÚinfixNotationÚjavaStyleCommentÚlineEndÚ	lineStartÚlocatedExprÚmakeHTMLTagsÚmakeXMLTagsÚmatchOnlyAtColÚmatchPreviousExprÚmatchPreviousLiteralÚ
nestedExprÚnullDebugActionÚoneOfÚopAssocÚoriginalTextForÚpythonStyleCommentÚquotedStringÚremoveQuotesÚreplaceHTMLEntityÚreplaceWithÚ
restOfLineÚsglQuotedStringÚ	stringEndÚstringStartÚtokenMapÚtraceParseActionÚunicodeStringÚwithAttributeÚ	withClassÚcommonÚunicodeÚtesting)(Ú__doc__Útypingr   r   Ú__version_info__r   r   rÁ   rM   ÚwarningsÚutilÚ
exceptionsÚactionsÚcorer3   r4   Úresultsr5   Úcore_builtin_exprsÚhelpersÚhelper_builtin_exprsrí   r6   r7   r8   rî   r9   rì   r:   Úcommon_builtin_exprsÚ	importlibr;   ÚsysÚglobalsrG   ÚstdoutÚUnionr,   rL   Ú__all__r.   r   r   ú<module>r     s4  ðði€ðV Ð Ð Ð Ð Ð ðyð yð yð yð y�:ñ yô yð yð0  �<  1 a¨°!Ñ4Ô4Ð Ø*Ð ØÔ*€Ø"€Ø:€
à Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð Ø &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ø Ð Ð Ð Ø Ð Ð Ð Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø Ð Ð Ð Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;à PÐ PÐ PÐ PÐ PÐ PÐ PÐ PÐ PÐ PØ .Ð .Ð .Ð .Ð .Ð .ðð ð ð ð ð ð ð ð  Ð Ð Ð Ð Ð Ø 
€
€
€
ð ˜g˜g™iœiÐ'Ð'ØÐØ˜W˜W™YœYÐ&Ð&ØÐØ˜7˜7™9œ9Ð$Ð$Ø€Nà Ð*Ð-AÑAÑ AÐ ðÐ ð> !œZð ð ¨E°#°t°)Ô,<ð ð ð ð ðDmð mð m€€€r   