+
     hT5  c                   s    ^RI 5 ^RIHtHtHt ^ RIHt  ! R R4      t]! ]4      P                  4        U u. uF  p ]	! V ]
4      '       g   K  V NK  	  up tR# u up i )   )Z*)DelimitedListany_open_tagany_close_tag)datetimec                   s	  a  ] tR t^t o Rt]! ]4      t ]! ]4      t	 ]
! ]4      P                  R4      P                  ]4      t ]
! ]4      P                  R4      P                  ]! ]^4      4      t ]! R4      P                  R4      P                  ]4      t ]! 4       P                  ]	4      R,           ]! 4       P                  ]	4      ,           P                  R4      t ]P)                  R 4       ]]]! ]! R	4      P-                  4       ],           4      ,           ,          P                  R
4      t ]P)                  ]4       ]! R4      P                  R4      P                  ]	4      t ]! R4      P                  R4      P                  ]	4      t ]],          ],          P                  R4      P7                  4       t ]! R4      P                  R4      P                  ]	4      t ]! R4      P                  R4      P                  ]	4      t ]
! ]] 4      P                  R4      t! ]! R4      P                  R4      t" ]! R4      P                  R4      t#]#R]#,           ^,          ,           P                  R4      t$]! ]#R]#,           R;,          ,           4      R,           ]! ]#R]#,           R;,          ,           4      ,           P                  R4      t%]%PM                  R 4       R]",           P                  R4      t'](! ]$]',          ]%,          P                  R 4      4      P                  R 4      t) ]! R!4      P                  R"4      t* ]+R<V 3R# lR$ ll4       t,]+R=V 3R% lR& ll4       t-]! R'4      P                  R(4      t. ]! R)4      P                  R*4      t/ ]! R+4      P                  R,4      t0 ]1P,                  ! 4       ]2P,                  ! 4       ,          t3]+V 3R- lR. l4       t4](! ]5! ]6! R/4      ( ]7! 4       ( ,           ]
! ]8R/R07      ,           ]! ]9! R14      ]:! ]7! 4       R/,          4      ( ,           4      ,           4      4      P7                  4       P                  R24      t;]<! ]! ]=P}                  4       ];,          R3R47      4      P                  R54      t? ]+! ]! R6 4      4      t@ ]+! ]! R7 4      4      tA ]! R>4      P                  R84      tB ]tC ]	tD ],tE ]-tF ]4tG ]@tH ]AtIR9tJV tKR:# )?pyparsing_commona{	  Here are some common low-level expressions that may be useful in
jump-starting parser development:

- numeric forms (:class:`integers<integer>`, :class:`reals<real>`,
  :class:`scientific notation<sci_real>`)
- common :class:`programming identifiers<identifier>`
- network addresses (:class:`MAC<mac_address>`,
  :class:`IPv4<ipv4_address>`, :class:`IPv6<ipv6_address>`)
- ISO8601 :class:`dates<iso8601_date>` and
  :class:`datetime<iso8601_datetime>`
- :class:`UUID<uuid>`
- :class:`comma-separated list<comma_separated_list>`
- :class:`url`

Parse actions:

- :class:`convert_to_integer`
- :class:`convert_to_float`
- :class:`convert_to_date`
- :class:`convert_to_datetime`
- :class:`strip_html_tags`
- :class:`upcase_tokens`
- :class:`downcase_tokens`

Example::

    pyparsing_common.number.run_tests('''
        # any int or real number, returned as the appropriate type
        100
        -100
        +100
        3.14159
        6.02e23
        1e-12
        ''')

    pyparsing_common.fnumber.run_tests('''
        # any int or real number, returned as float
        100
        -100
        +100
        3.14159
        6.02e23
        1e-12
        ''')

    pyparsing_common.hex_integer.run_tests('''
        # hex numbers
        100
        FF
        ''')

    pyparsing_common.fraction.run_tests('''
        # fractions
        1/2
        -3/4
        ''')

    pyparsing_common.mixed_integer.run_tests('''
        # mixed fractions
        1
        1/2
        -3/4
        1-3/4
        ''')

    import uuid
    pyparsing_common.uuid.set_parse_action(token_map(uuid.UUID))
    pyparsing_common.uuid.run_tests('''
        # uuid
        12345678-1234-5678-1234-567812345678
        ''')

prints::

    # any int or real number, returned as the appropriate type
    100
    [100]

    -100
    [-100]

    +100
    [100]

    3.14159
    [3.14159]

    6.02e23
    [6.02e+23]

    1e-12
    [1e-12]

    # any int or real number, returned as float
    100
    [100.0]

    -100
    [-100.0]

    +100
    [100.0]

    3.14159
    [3.14159]

    6.02e23
    [6.02e+23]

    1e-12
    [1e-12]

    # hex numbers
    100
    [256]

    FF
    [255]

    # fractions
    1/2
    [0.5]

    -3/4
    [-0.75]

    # mixed fractions
    1
    [1]

    1/2
    [0.5]

    -3/4
    [-0.75]

    1-3/4
    [1.75]

    # uuid
    12345678-1234-5678-1234-567812345678
    [UUID('12345678-1234-5678-1234-567812345678')]
integerzhex integerz[+-]?\d+zsigned integerZ/fractionc                s0    V ^ ,          V R,          ,          # )    i )tt   &5/usr/lib/python3.14/site-packages/pyparsing/common.py<lambda>pyparsing_common.<lambda>   s    AB    Z-z"fraction or mixed integer-fractionz[+-]?(?:\d+\.\d*|\.\d+)zreal numberz@[+-]?(?:\d+(?:[eE][+-]?\d+)|(?:\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?)z$real number with scientific notationnumberz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberz2(?i)[+-]?((\d+\.?\d*(e[+-]?\d+)?)|nan|inf(inity)?)
ieee_float
identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}zIPv4 addressz[0-9a-fA-F]{1,4}hex_integerZ:zfull IPv6 addressz::zshort IPv6 addressc                s,    \        R  V  4       4      ^8  # )c              3   st   "   T F.  p\         P                  P                  V4      '       g   K*  ^x  K0  	  R# 5i)r    N)r   
_ipv6_partZmatches)Z.0r
   s   & r   Z	<genexpr>Z,pyparsing_common.<lambda>.<locals>.<genexpr>   s&     O!B'7'B'B'J'J2'Naa!s   '8
8)sumtr   r   r   r      s    #O!OORSSr   z::ffff:zmixed IPv6 addresszIPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}zMAC addressc                    < V ^8  d   QhRS[ /#    fmtstrZformat__classdict__   "r   __annotate__pyparsing_common.__annotate__  s      S r   c                   a  V 3R lpV# )a  
Helper to create a parse action for converting parsed date string to Python datetime.date

Params -
- fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``)

Example::

    date_expr = pyparsing_common.iso8601_date.copy()
    date_expr.set_parse_action(pyparsing_common.convert_to_date())
    print(date_expr.parse_string("1999-12-31"))

prints::

    [datetime.date(1999, 12, 31)]
c                 s   <  \         P                  ! V^ ,          S4      P                  4       #   \         d   p\	        Y\        T4      4      hRp?ii ; ir   N)r   strptimeZdate
ValueErrorParseExceptionr   )ZssZllr
   ver      &&& r   cvt_fnZ0pyparsing_common.convert_to_date.<locals>.cvt_fn  sI    6((A499;; 6$RSW556s   +/ AAAr	   r   r+      f r   convert_to_dateZ pyparsing_common.convert_to_date  s    &	6 r   c                r   r   r   r   r!   r   r"   r#     s       r   c                r$   )a  Helper to create a parse action for converting parsed
datetime string to Python datetime.datetime

Params -
- fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``)

Example::

    dt_expr = pyparsing_common.iso8601_datetime.copy()
    dt_expr.set_parse_action(pyparsing_common.convert_to_datetime())
    print(dt_expr.parse_string("1999-12-31T23:59:59.999"))

prints::

    [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)]
c                 s   <  \         P                  ! V^ ,          S4      #   \         d   p\        Y\	        T4      4      hRp?ii ; ir%   )r   r&   r'   r(   r   )slr   r)   r   r*   r   r+   Z4pyparsing_common.convert_to_datetime.<locals>.cvt_fn1  s@    4((1s33 4$Q3r7334s   ! AAAr	   r,   r-   r   convert_to_datetimeZ$pyparsing_common.convert_to_datetime  s    &	4 r   z7(?P<year>\d{4})(?:-(?P<month>\d\d)(?:-(?P<day>\d\d))?)?zISO8601 datez(?P<year>\d{4})-(?P<month>\d\d)-(?P<day>\d\d)[T ](?P<hour>\d\d):(?P<minute>\d\d)(:(?P<second>\d\d(\.\d*)?)?)?(?P<tz>Z|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}ZUUIDc                s,   < V ^8  d   QhRS[ RS[RS[/# )r   r/   r0   tokens)r   intZParseResultsr   r!   r   r"   r#   I  s'     K K3 K3 K Kr   c                sN    \         P                  P                  V^ ,          4      # )a  Parse action to remove HTML tags from web page HTML source

Example::

    # strip HTML links from normal text
    text = '<td>More info at the <a href="https://github.com/pyparsing/pyparsing/wiki">pyparsing</a> wiki page</td>'
    td, td_end = make_html_tags("TD")
    table_text = td + SkipTo(td_end).set_parse_action(pyparsing_common.strip_html_tags)("body") + td_end
    print(table_text.parse_string(text).body)

Prints::

    More info at the pyparsing wiki page
)r   _html_stripperZtransform_string)r/   r0   r2   s   &&&r   strip_html_tagsZ pyparsing_common.strip_html_tagsH  s       ..??q	JJr   Z,)Zexclude_charsz 	Z	commaItemZ )Zdefaultzcomma separated listc                "    V P                  4       # N)Zupperr   r   r   r   r   k  s
    QWWYr   c                r6   r7   )Zlowerr   r   r   r   r   n  s
    qwwyr   urlr	   N)r   i   )z%Y-%m-%d)z%Y-%m-%dT%H:%M:%S.%fa  (?P<url>(?:(?:(?P<scheme>https?|ftp):)?\/\/)(?:(?P<auth>\S+(?::\S*)?)@)?(?P<host>(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(:(?P<port>\d{2,5}))?(?P<path>\/[^?# ]*)?(\?(?P<query>[^#]*))?(#(?P<fragment>\S*))?))LZ__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Z	token_mapr3   Zconvert_to_integerZfloatZconvert_to_floatZWordZnumsZset_nameZset_parse_actionr   Zhexnumsr   ZRegexZsigned_integerr   Zadd_parse_actionZOptZsuppressZmixed_integerr   ZrealZsci_realZ
streamliner   r   r   Z
identcharsZidentbodycharsr   Zipv4_addressr   Z_full_ipv6_addressZ_short_ipv6_addressZadd_conditionZ_mixed_ipv6_addressZCombineZipv6_addressZmac_addressZstaticmethodr.   r1   Ziso8601_dateZiso8601_datetimeZuuidr   r   r4   r5   Z	OneOrMoreZLiteralZLineEndZ
printablesZWhiteZ
FollowedByZ_commasepitemr   Zquoted_stringZcopyZcomma_separated_listZupcase_tokensZdowncase_tokensr8   ZconvertToIntegerZconvertToFloatZconvertToDateZconvertToDatetimeZstripHTMLTagsZupcaseTokensZdowncaseTokensZ__static_attributes__Z__classdictcell__)r    s   @r   r   r      sg    Ob #3 !' 4j!!),==>PQGD 	W}->>yb?QR  G 	k	"	#		,	- 
 W 	))*:;
	


+
+,<
=	> hz	 
 U78 	>CC(9(9(;h(F$GGGh34  g""3' 	()	-	 		*	+ 	
 M 	QR	8	9		*	+ 
/ o.88BMMOFG 	./	)			*	+ 
 4 	CD	,			*	+ 
 ]j.1::<HJdVh~  3*+44]CJ$j(8A'==GG 	J#
*f445
	
jC*,66
7	8 h#$	 
 %%S %|3==>RS	1	14G	GQQ	
 h~	 
 0Eh}  G  4   4 Bh~  $ 	Rh!"  ]FGPPQWXD5!**,}/E/E/GGNK K$ 	9*z56 eEljS&A%AABC	
 
	+	  )M =0"=h%&  e +>!?@M7"9-@#ABO7 *	.\ huo] ^ & *6%N4#M3+7#M3 L1$N3r   r   N)ZcoreZhelpersr   r   r   r   r   ZvarsZvaluesZ
isinstanceZParserElementZ_builtin_exprs)Zvs   0r   <module>r9      sY     ? ? j4 j4\ $%,,..!*Q2NAA. s   AA