+
    oi\<                     f    ^ RI Ht ^ RIt^ RIt^ RIt^RIHtHtHtH	t	H
t
 ^RIHt  ! R R4      tR# )    )contextmanagerN)ParserElementParseExceptionKeyword__diag__
__compat__)core_builtin_exprsc                      a  ] tR t^t o Rt ! R R4      t ! R R]P                  4      t]	RRR	R
R/V 3R lR lll4       t
RtV tR# )pyparsing_testz:
namespace class for classes useful in writing unit tests
c                   H   a  ] tR t^t o RtR tR tR tR tR t	R t
RtV tR	# )
&pyparsing_test.reset_pyparsing_contexta_  
Context manager to be used when writing unit tests that modify pyparsing config values:
- packrat parsing
- bounded recursion parsing
- default whitespace characters
- default keyword characters
- literal string auto-conversion class
- ``__diag__`` settings

Example:

.. testcode::

    ppt = pyparsing.pyparsing_test

    class MyTestClass(ppt.TestParseResultsAsserts):
        def test_literal(self):
            with ppt.reset_pyparsing_context():
                # test that literals used to construct
                # a grammar are automatically suppressed
                ParserElement.inline_literals_using(Suppress)

                term = Word(alphas) | Word(nums)
                group = Group('(' + term[...] + ')')

                # assert that the '()' characters
                # are not included in the parsed tokens
                self.assertParseAndCheckList(
                    group,
                    "(abc 123 def)",
                    ['abc', '123', 'def']
                )

            # after exiting context manager, literals
            # are converted to Literal expressions again
c                    / V n         R # N_save_contextselfs   &t/Users/tonyclaw/.openclaw/workspace/scripts/youtube-playlists/venv/lib/python3.14/site-packages/pyparsing/testing.py__init__/pyparsing_test.reset_pyparsing_context.__init__>   s
    !#D    c                   \         P                  V P                  R &   \        P                  V P                  R&   \         P
                  V P                  R&   \         P                  V P                  R&   \         P                  V P                  R&   \         P                  '       d)   \         P                  P                  V P                  R&   MRV P                  R&   \         P                  V P                  R&   \         P                  V P                  R&   \        P                   Uu/ uF  q\        \        V4      bK  	  upV P                  R	&   R
\        P                   /V P                  R&   V # u upi )default_whitespacedefault_keyword_charsliteral_string_classverbose_stacktracepackrat_enabledpackrat_cache_sizeNpackrat_parserecursion_enabledr   collect_all_And_tokensr   )r   DEFAULT_WHITE_CHARSr   r   DEFAULT_KEYWORD_CHARS_literalStringClassr   _packratEnabledpackrat_cachesize_parse_left_recursion_enabledr   
_all_namesgetattrr   r!   )r   names   & r   save+pyparsing_test.reset_pyparsing_context.saveA   sP   7D7X7XD34:A:W:WD67 11 56 8E7W7WD344A4Q4QD01,,,!//44 ""#78 <@""#782?2F2FD/55 23
 ;C:M:M.:M$gh--:M.Dz*
 )**K*K0D|, K.s   +E5c                   \         P                  V P                  R ,          8w  d(   \         P                  ! V P                  R ,          4       V P                  R,          \         n        V P                  R,          \
        n        \         P                  ! V P                  R,          4       V P                  R,          P                  4        F3  w  rV'       d   \        P                  M\        P                  ! V4       K5  	  R\         n        V P                  R,          '       d)   \         P                  ! V P                  R,          4       MV P                  R,          \         n        V P                  R	,          \         n        \          F  pVP#                  R4       K  	  V P                  R
,          \$        n        V # )r   r   r   r   r   Fr   r   r   r    r   )r   r"   r   set_default_whitespace_charsr   r   r#   inline_literals_usingitemsr   enabledisabler%   enable_packratr(   r)   r	   	set_debugr   r!   )r   r,   valueexprs   &   r   restore.pyparsing_test.reset_pyparsing_context.restorea   sT    11%%&:;< ::&&';< 04/A/ABV/WM,,0,>,>?V,WG)//""#9:  $11*=CCE$)x/?/??F  F -2M)!!"344,,T-?-?@T-UV'+'9'9/'J$484F4F#5M1
 +u% + 150B0B<0PJ-Kr   c                p    \        V 4      ! 4       pVP                  P                  V P                  4       V# r   )typer   update)r   rets   & r   copy+pyparsing_test.reset_pyparsing_context.copy   s,    t*,C$$T%7%78Jr   c                "    V P                  4       # r   )r-   r   s   &r   	__enter__0pyparsing_test.reset_pyparsing_context.__enter__   s    99;r   c                &    V P                  4        R # r   )r9   )r   argss   &*r   __exit__/pyparsing_test.reset_pyparsing_context.__exit__   s    LLNr   r   N)__name__
__module____qualname____firstlineno____doc__r   r-   r9   r?   rB   rF   __static_attributes____classdictcell____classdict__s   @r   reset_pyparsing_contextr      s0     #	J	$	@#	J	
		 	r   rQ   c                   f   a  ] tR t^t o RtR	R ltR
R ltR
R ltRR lt]	]
RR3R l4       tRtV tR# )&pyparsing_test.TestParseResultsAssertsz[
A mixin class to add parse results assertion methods to normal unittest.TestCase classes.
Nc                    Ve"   V P                  W!P                  4       VR7       Ve$   V P                  W1P                  4       VR7       R# R# )z
Unit test assertion to compare a :class:`ParseResults` object with an optional ``expected_list``,
and compare any defined results names with an optional ``expected_dict``.
Nmsg)assertEqualas_listas_dict)r   resultexpected_listexpected_dictrV   s   &&&&&r   assertParseResultsEquals?pyparsing_test.TestParseResultsAsserts.assertParseResultsEquals   sI     (  0@c J(  0@c J )r   c                    VP                  VRR7      pV'       d   \        VP                  4       4       M\        VP                  4       4       V P	                  WcVR7       R# )z
Convenience wrapper assert to test a parser element and input string, and assert that
the resulting :meth:`ParseResults.as_list` is equal to the ``expected_list``.
T	parse_all)r[   rV   Nparse_stringprintdumprX   r]   )r   r8   test_stringr[   rV   verboserZ   s   &&&&&& r   assertParseAndCheckList>pyparsing_test.TestParseResultsAsserts.assertParseAndCheckList   M     &&{d&CFfkkm$fnn&'))&SV)Wr   c                    VP                  VRR7      pV'       d   \        VP                  4       4       M\        VP                  4       4       V P	                  WcVR7       R# )z
Convenience wrapper assert to test a parser element and input string, and assert that
the resulting :meth:`ParseResults.as_dict` is equal to the ``expected_dict``.
Tr`   )r\   rV   Nrb   )r   r8   rf   r\   rV   rg   rZ   s   &&&&&& r   assertParseAndCheckDict>pyparsing_test.TestParseResultsAsserts.assertParseAndCheckDict   rj   r   c                   Vw  rEVf   T P                  YCe   TMRR7       R# \        WR4       UUu. uF  w  rg. VOVN5NK  	  pppV F  w  rp\        R V 4       R4      p\        R V 4       R4      pVeI   T P                  Y;'       g    TR7      ;_uu_ 4        \	        V
\
        4      '       d   V
h RRR4       Kx  \        R V 4       R4      p\        R V 4       R4      pW3R8w  d"   T P                  T
TTT;'       g    TR	7       K  \        R
V	: 24       K  	  T P                  YCe   TMRR7       R# u uppi   + '       g   i     EK  ; i)a  
Unit test assertion to evaluate output of
:meth:`~ParserElement.run_tests`.

If a list of list-dict tuples is given as the
``expected_parse_results`` argument, then these are zipped
with the report tuples returned by ``run_tests()``
and evaluated using :meth:`assertParseResultsEquals`.
Finally, asserts that the overall
`:meth:~ParserElement.run_tests` success value is ``True``.

:param run_tests_report: the return value from :meth:`ParserElement.run_tests`
:type run_tests_report: tuple[bool, list[tuple[str, ParseResults | Exception]]]
:param expected_parse_results: (optional)
:type expected_parse_results: list[tuple[str | list | dict | Exception, ...]]
Nzfailed runTestsrU   c              3   V   "   T F  p\        V\        4      '       g   K  Vx  K!  	  R # 5ir   )
isinstancestr.0exps   & r   	<genexpr>Npyparsing_test.TestParseResultsAsserts.assertRunTestResults.<locals>.<genexpr>   s      QJsC<P   )
)c              3      "   T F7  p\        V\        4      '       g   K  \        V\        4      '       g   K3  Vx  K9  	  R # 5ir   )rp   r<   
issubclass	Exceptionrr   s   & r   ru   rv      s2      #+C%c40 5?Y5O #+s   AA
A)expected_exceptionrV   c              3   V   "   T F  p\        V\        4      '       g   K  Vx  K!  	  R # 5ir   )rp   listrr   s   & r   ru   rv           JJsD4Irw   c              3   V   "   T F  p\        V\        4      '       g   K  Vx  K!  	  R # 5ir   )rp   dictrr   s   & r   ru   rv      r~   rw   )r[   r\   rV   zno validation for NN)
assertTruezipnextassertRaisesrp   rz   r]   rd   )r   run_tests_reportexpected_parse_resultsrV   run_test_successrun_test_resultsrptexpectedmergedrf   rZ   fail_msgr{   r[   r\   s   &&&&           r   assertRunTestResults;pyparsing_test.TestParseResultsAsserts.assertRunTestResults   s   & 2B.%-$#FW     &))9%R%RMC !# x %R   28-X   Q QSWX%)#+
 &" &1**+=??s +   &fi88"(L 9  %)JJD%M %)JJD%M &5E55"*7*7 (C	 6   2;/BCG 28L OO _cBS  U$  s   D<EEc              #  `  "   VeW   \        V\        4      '       d   \        P                  ! V4      pV P	                  WVR7      ;_uu_ 4       pVx  R R R 4       R # V P                  WR7      ;_uu_ 4       pVx  R R R 4       R #   + '       g   i     R # ; i  + '       g   i     R # ; i5i)NrU   )rp   rq   reescapeassertRaisesRegexr   )r   exc_typeexpected_msgrV   ctxs   &&&& r   assertRaisesParseExceptionApyparsing_test.TestParseResultsAsserts.assertRaisesParseException  s      'lC00#%99\#:L++H+LLPSI ML &&x&99SI :9	 MLL :99s6   AB.B$B.7B<
B.B		B.B+	%	B. )NNN)NTr   )rH   rI   rJ   rK   rL   r]   rh   rl   r   r   r   r   rM   rN   rO   s   @r   TestParseResultsAssertsrS      s>     	
	K	X	XG	R 
)$	 
	r   r   NTindent base_1c                  < V ^8  d   QhRS[ RS[P                  S[,          RS[P                  S[,          RS[RS[ RS[P                  S[ ,          RS[P                  S[ ,          RS[P
                  S[ S[3,          R	S[R
S[ /
# )   s
start_lineend_lineexpand_tabseol_markmark_spacesmark_controlr   r   return)rq   typingOptionalintboolUnion)formatrP   s   "r   __annotate__pyparsing_test.__annotate__  s     x
 x
x
OOC(x
 //#&x
 	x

 x
 __S)x
 ooc*x
 S#X&x
 x
 
x
r   c          
     D  aaa V'       d   V P                  4       p \        S\        4      '       d
   RS,          oSP                  4       oVe   \        P                  ! \
        V4      pVR8X  dQ   \        \        ^ ^!4      \        RR4      4       U	U
u/ uF  w  rWbK	  	  pp	p
RV^&   \
        P                  V4      pRoMK\        V4      p\
        P                  \        \        ^ ^ 4      4      ^.,            U	u/ uF  qVbK  	  up	4      pV P                  V4      p VeL   VR8w  dE   VR8X  d,   \
        P                  ^	R^ R/4      pV P                  V4      p MV P                  RV4      p Vf   ^ pVf   \        V P                  4       4      p\        V\        V P                  4       4      4      p\        \!        ^ V4      V4      pVR8w  d%   V P                  4       \!        W,
          ^ 4      V pM:V P#                  R	4      \!        W,
          ^ 4      V  Uu. uF  pVR	,           NK  	  ppV'       g   R# \        \        V4      4      o\!        R
 V 4       4      pS RS^,           ,           2pV^c8  dS   TV'       d   RMR,           RP%                  R \        \!        V^d,          ^4      4       4       4      ,           R,           pMRpV'       d   RMRV,           RP%                  R \        V) ^
,          ) 4       4       4      ,           R,           pRpTV'       d   RMR,           VV) ^
,          ) ,          ,           R,           pVV,           V,           RP%                  VVV3R l\'        WV,           R7       4       4      ,           R,           # u up
p	i u up	i u upi )u  
Helpful method for debugging a parser - prints a string with line and column numbers.
(Line and column numbers are 1-based by default - if debugging a parse action,
pass base_1=False, to correspond to the loc value passed to the parse action.)

:param s: string to be printed with line and column numbers
:param start_line: starting line number in s to print (default=1)
:param end_line: ending line number in s to print (default=len(s))
:param expand_tabs: expand tabs to spaces, to match the pyparsing default
:param eol_mark: string to mark the end of lines, helps visualize trailing spaces
:param mark_spaces: special character to display in place of spaces
:param mark_control: convert non-printing control characters to a placeholding
                     character; valid values:

                     - ``"unicode"`` - replaces control chars with Unicode symbols, such as "␍" and "␊"
                     - any single character string - replace control characters with given string
                     - ``None`` (default) - string is displayed as-is


:param indent: string to indent with line and column numbers; if an int
               is passed, converted to ``" " * indent``
:param base_1: whether to label string using base 1; if False, string will be
               labeled based at 0

:returns: input string with leading line numbers and column number headers

.. versionchanged:: 3.2.0
   New ``indent`` and ``base_1`` arguments.
 unicodei $  i3$  i!$  r   i	$  i#$  u   ␊c              3   8   "   T F  p\        V4      x  K  	  R # 5ir   )len)rs   lines   & r   ru   3pyparsing_test.with_line_numbers.<locals>.<genexpr>k  s     93t99s   c              3   J   "   T F  pR V^,           ^d,           2x  K  	  R# 5i)r   Nzc                                                                                                   r   rs   is   & r   ru   r   r  s(      ?  j!a%30?s   !#
c              3   H   "   T F  pR V^,           ^
,           2x  K  	  R# 5i)z	         Nr   r   s   & r   ru   r   ~  s!     X:WQ	1q5B,0:Ws    "
12345678900c              3   F   <"   T F  w  rS VS R 2 RV S 2x  K  	  R# 5i)d:Nr   )rs   r   r   r   r   lineno_widths   &  r   ru   r     s7      LGA (1l^1,-QtfXJ?Ls   !)start)
expandtabsrp   r   r   castrq   r   range	maketransordr}   	translatereplacer   
splitlinesminmaxsplitjoin	enumerate)r   r   r   r   r   r   r   r   r   cutranstable_maptblord_mark_controls_linesr   max_line_lenleadheader0header1digitsheader2r   s   &&&&f&&d$             @r   with_line_numbers pyparsing_test.with_line_numbers  sk   T Afc""6\F""$#!;;sL9Ly(%(q"uVV7L%M"%MTQAD%M  " '-s#mmN3#&|#4 mm26uQ|2Du2LM2LQ((2LM C A"{c'9i'mmQF$;<KK$IIc;/J1<<>*HxQ\\^!45Q
+X6
9$llnS)<a%@8LG GGEN3z/BA+FRRD uR   3x=)999#!123422S*'' "3|s':A#>?    G RsggX%<-SUBU@V:WXXY  	 &Bc*V,"9L7M-NNQUU 	  ii (V8KL  		
}" N&s   N:NNr   )NNT|NN)rH   rI   rJ   rK   rL   rQ   unittestTestCaser   staticmethodr   rM   rN   rO   s   @r   r   r      s^     w wrB("3"3 BH x
 *,x
 x
 x
 x
r   r   )
contextlibr   r   r   r   corer   r   r   r   r   r   r	   r   r   r   r   <module>r      s.    & 	    !{
 {
r   