hfUddlZddlZddlmZddlmZmZmZmZm Z m Z ddl m Z eGddZ Gdd eZid d d d dddddddddejdejddddddddd ejd!ejd"eje je jzejejzd#d$d%d&d'd(d)d*d+d,d-d.Zd/ed0<Gd1d2ZdS)3N) dataclass)DictIteratorNoReturnOptionalTupleUnion) Specifierc.eZdZUeed<eed<eed<dS)TokennametextpositionN)__name__ __module__ __qualname__str__annotations__intt/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/packaging/_tokenizer.pyr r s+ III IIIMMMMMrr cPeZdZdZdededeeefddffd ZdefdZxZ S) ParserSyntaxErrorz7The provided source text could not be parsed correctly.messagesourcespanreturnNcr||_||_||_tdS)N)rrrsuper__init__)selfrrr __class__s rr"zParserSyntaxError.__init__s6    rcd|jdzd|jd|jdz zzdz}d|j|j|gS)N r~r ^z )rjoinrr)r#markers r__str__zParserSyntaxError.__str__ sOty|#cTYq\DIaL-H&IICO}}dlDK@AAAr) rrr__doc__rrrr"r+ __classcell__)r$s@rrrsAA    CHo        BBBBBBBBBrrLEFT_PARENTHESISz\(RIGHT_PARENTHESISz\) LEFT_BRACKETz\[ RIGHT_BRACKETz\] SEMICOLON;COMMA, QUOTED_STRINGzk ( ('[^']*') | ("[^"]*") ) OPz(===|==|~=|!=|<=|>=|<|>)BOOLOPz \b(or|and)\bINz\bin\bNOTz\bnot\bVARIABLEa \b( python_version |python_full_version |os[._]name |sys[._]platform |platform_(release|system) |platform[._](version|machine|python_implementation) |python_implementation |implementation_(name|version) |extra )\b SPECIFIERATz\@URLz[^ \t]+ IDENTIFIERz\b[a-zA-Z0-9][a-zA-Z0-9._-]*\bVERSION_PREFIX_TRAILz\.\*z\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*z[ \t]+$)VERSION_LOCAL_LABEL_TRAILWSEND&Dict[str, Union[str, re.Pattern[str]]] DEFAULT_RULESc eZdZdZdeddddfdZdeddfd Zd d ded edefd Zdedede fdZ de fdZ ddddede e de e defdZejdededededfdZdS) TokenizerzContext-sensitive token parsing. Provides methods to examine the input stream to check whether the next token matches. rrulesrErNcv||_d|D|_d|_d|_dS)Nc>i|]\}}|tj|Sr)recompile).0rpatterns r z&Tokenizer.__init__..fs52 2 2 *7$D"*W%%2 2 2 rr)ritemsrI next_tokenr)r#rrIs rr"zTokenizer.__init___sG  2 2 ;@;;==2 2 2  ,0 rrc\||r|dSdS)z8Move beyond provided token name, if at current position.N)checkread)r#rs rconsumezTokenizer.consumels1 ::d    IIKKKKK  rF)peekrWc|jJd|d|j||jvs Jd||j|}||j|j}|dS|s!t ||d|j|_dS)zCheck whether the next token has the provided name. By default, if the check succeeds, the token *must* be read before another check. If `peek` is set to `True`, the token is not loaded and would need to be checked again. NzCannot check for z, already have zUnknown token name: FrT)rRrImatchrrr )r#rrW expressionrYs rrTzTokenizer.checkqs O # # It I Ido I I $ # #tz!!!#B$#B#B!!!Z%   dm<< =5 C#D%(DMBBDOtrexpectedc||s|d||S)zsExpect a certain token name next, failing with a syntax error otherwise. The token is *not* read. z Expected )rTraise_syntax_errorrU)r#rr[s rexpectzTokenizer.expectsD zz$ B))*@h*@*@AA Ayy{{rcn|j}|J|xjt|jz c_d|_|S)z%Consume the next token and return it.N)rRrlenr)r#tokens rrUzTokenizer.reads9    UZ(  r) span_startspan_endrrbrcc\||jn|||jn|f}t||j|)z.Raise ParserSyntaxError at the given position.N)rr)rrr)r#rrbrcrs rr]zTokenizer.raise_syntax_errorsK(/DMMZ%-DMM8  ;    r open_token close_tokenaroundc#K||r|j}|nd}dV|dS||s |d|d|d|||dS)NzExpected matching z for z, after )rb)rTrrUr])r#rerfrg open_positions renclosing_tokenszTokenizer.enclosing_tokenss ::j ! ! ! MM IIKKKK M   Fzz+&&   # #S[SSzSS6SS( $    r)rrrr,rr"rVboolrTr r^rUrrrr] contextlibcontextmanagerrrjrrrrHrHXs  8      CD 05#*3SUe%)"&     SM  3-       $,/rvsz !!!!!!CCCCCCCCCCCCCCCC!!!!!!   BBBBB BBB*0;0;0;E0;U 0;  0;  T 0;ZRZ    0;" %#0;$ o%0;& )'0;( :)0;*    +0;J% (DD R]"K0;R %S0;T :U0;V3W0;XGY0;Z"D  _0;0;0; 7000fhhhhhhhhhhr