+
    {h2  c                   sR    R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt  ! R R4      t	R# )8A lexical analyzer class for simple shell-like syntaxes.N)deque)StringIO)Optionalc                   sp   a  ] tR t^t o RtRR ltR tRR ltR tR t	R t
R	 tRR
 ltR tR t]tRtV tR# )shlexr    Nc                s
   \        V\        4      '       d   \        V4      pVe   Wn        W n        M\
        P                  V n        R V n        W0n        V'       d	   R V n        MRV n        RV n	        RV n
        RV n        RV n        RV n        RV n        RV n        R	V n        \#        4       V n        ^V n        ^ V n        RV n        \#        4       V n        R V n        V'       g   RpMVR
J d   RpW@n        V'       dw   \#        4       V n        V ;P                  R,          un
        V P                  P5                  \6        P9                  V4      4      pV P                  P;                  V4      V n
        R V n        RV n        R # )N Z#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_z 	
Fz'"Z\" Tz();<>|&z~-./*?=) 
isinstancestrr   instreaminfilesysZstdinposixeof
commenters	wordchars
whitespacewhitespace_splitquotesescapeescapedquotesstater   pushbacklinenodebugtoken	filestacksourcepunctuation_chars_pushback_charsZ	maketransZdictZfromkeysZ	translatelast_wordbreak_pos
wordbreaks)selfr
   r   r   r   Zts   &&&&& @/usr/lib/python3.14/site-packages/argcomplete/packages/_shlex.py__init__Zshlex.__init__   s8   h$$)H$M KIIDMDK
DHDHZ
 $ % $'
$w

 %  "$& )!2*/'D NNi'N((7H)IJA!^^55a8DN #'    c                s    V P                   ^8  d   \        R\        V4      ,           4       V P                  P	                  V4       R# )z:Push a token onto the stack popped by the get_token methodzshlex: pushing token N)r   printreprr   
appendleft)r!   tok   &&r"   
push_tokenZshlex.push_tokenJ   s1    ::?)DI56  %r$   c                s~   \        V\        4      '       d   \        V4      pV P                  P	                  V P
                  V P                  V P                  34       W n        Wn        ^V n        V P                  '       d;   Ve   \        RV P
                  : 24       R# \        RV P                  : 24       R# R# )z9Push an input source onto the lexer's input source stack.Nzshlex: pushing to file zshlex: pushing to stream )
r   r	   r   r   r'   r   r
   r   r   r%   )r!   	newstreamnewfile   &&&r"   push_sourceZshlex.push_sourceP   s     i%% +I!!4;;t{{"KL!:::"T[[BCt}}FG	 r$   c                s   V P                   P                  4        V P                  P                  4       w  V n        V n         V n        V P                  '       d)   \        RV P                   V P
                  3,          4       RV n        R# )zPop the input source stack.zshlex: popping to %s, line %dr   N)	r
   Zcloser   popleftr   r   r   r%   r   r!      &r"   
pop_sourceZshlex.pop_source_   s\    48NN4J4J4L1dmT[:::1T]]DKK4PPQ
r$   c                s   V P                   '       dI   V P                   P                  4       pV P                  ^8  d   \        R\	        V4      ,           4       V# V P                  4       pV P                  e_   W P                  8X  dO   V P                  V P                  4       4      pV'       d   Vw  rEV P                  WT4       V P                  4       pK^  W P                  8X  dA   V P                  '       g   V P                  # V P                  4        V P                  4       pKP  V P                  ^8  d9   W P                  8w  d   \        R\	        V4      ,           4       V# \        R4       V# )zBGet a token from the input stream (or from stack if it's nonempty)zshlex: popping token zshlex: token=zshlex: token=EOF)r   r/   r   r%   r&   
read_tokenr   
sourcehookr.   	get_tokenr   r   r2   )r!   r(   ZrawZspecr,   r+   s   &     r"   r5   Zshlex.get_tokeng   s   ===--'')CzzQ-S	9:Joo;;"$t'89+/(W$$Y8nn&XXo>>>xx!nn&::?hhoS	12 
 ()
r$   c                s   R pRp V P                   '       d.   V P                  '       d   V P                  P                  4       pMV P                  P	                  ^4      pVR8X  d   V ;P
                  ^,          un        V P                  ^8  d   \        RV P                  : RV: 24       V P                  f
   RV n	        EMV P                  R8X  Ed   V'       g
   RV n        EMW0P                  9   dN   V P                  ^8  d   \        R4       V P                  '       g   V P                  '       d   V'       d   EM1EK@  W0P                  9   d7   V P                  P                  4        V ;P
                  ^,          un        EK  V P                  '       d   W0P                  9   d   R	pW0n        EK  W0P                  9   d   W0n	        R	V n        EK  W0P                   9   d   W0n	        R
V n        EK  W0P                   9   d"   V P                  '       g   W0n	        W0n        EK$  V P"                  '       dE   W0n	        R	V n        W0P$                  9   d%   \'        V P                  4      ^,
          V n        EKw  EKz  W0n	        V P                  '       g   V P                  '       d   V'       d   EMEK  V P                  V P                   9   d   RpV'       g(   V P                  ^8  d   \        R4       \+        R4      hW0P                  8X  d?   V P                  '       g#   V ;P                  V,          un	        RV n        EM-R	V n        EKK  V P                  '       dA   W0P                  9   d1   V P                  V P,                  9   d   V P                  pW0n        EK  V ;P                  V,          un	        EK  V P                  V P                  9   d   V'       g(   V P                  ^8  d   \        R4       \+        R4      hW P                   9   d:   W0P                  8w  d*   W28w  d$   V ;P                  V P                  ,          un	        V ;P                  V,          un	        W n        EKn  V P                  R9   g   EK  V'       g
   RV n        EMW0P                  9   dU   V P                  ^8  d   \        R4       RV n        V P                  '       g   V P                  '       d   V'       d   EMzEK  W0P                  9   d   V P                  P                  4        V ;P
                  ^,          un        V P                  '       d9   RV n        V P                  '       g   V P                  '       d   V'       d   EMEK  EK  V P                  '       d   W0P                   9   d
   W0n        EK  V P                  '       d   W0P                  9   d   R	pW0n        EK  V P                  R
8X  da   W0P                   9   d   V ;P                  V,          un	        EK  W0P                  9  d   V P                  P/                  V4       RV n        EMW0P                  9   g#   W0P                   9   g   V P"                  '       dQ   V ;P                  V,          un	        W0P$                  9   d%   \'        V P                  4      ^,
          V n        EK  EK  V P                   '       d   V P                  P/                  V4       MV P0                  P3                  V4       V P                  ^8  d   \        R4       RV n        V P                  '       g   V P                  '       d
   V'       d   MEKn  V P                  pRV n	        V P                  '       d   V'       g
   VR8X  d   RpV P                  ^8  d0   V'       d   \        R\5        V4      ,           4       M\        R4       V P                  R8X  d   RV n        V# )Fr   TZ
zshlex: in state z I see character: Nr   z+shlex: I see whitespace in whitespace stateacz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped characterz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r6   r7   )r   r   Zpopr
   Zreadr   r   r%   r   r   r   r   r   Zreadliner   r   r   r   r    Zlenr   Z
ValueErrorr   Zappendr   r'   r&   )r!   ZquotedZescapedstateZnextcharZresults   &    r"   r3   Zshlex.read_token   s@   %%%$*>*>*>//335==--a04q zzQ$**hWXzz!
s"!%DJ0zzQKLzzzdjjjV 0MM**,KK1$KKZZZH$;#&L!)J/!)J!$DJ!7!77!)J!$DJ,:::%-
!)J***!)J!$DJ??225djj/A2E/ 3 "*JzzzdjjjV t{{*zzQ@A$%;<<zz):::

h.
%(
%(
ZZZH$;

dN`N`@`#'::L!)JJJ(*JJt{{*zzQ@A$%;<<  ;;.8zz3IhNfJJ$**,J

h&
)
z)!%DJ0zzQEF!$DJzzzdjjjV 0MM**,KK1$Kzzz%(
:::$***!$ " ZZZH$;!)JZZZH$;#&L!)JZZ3&#9#99

h.

#??: 0077A%(
/8{{3JdNcNcNcJJ(*J??225djj/A2E/ 3 ---,,33H=00:zzQFG!$DJzzzdjjjV  $


:::f2F::>)DL89,-::&*D#r$   c                s\   V^ ,          R8X  d   V^R p\        V P                  \        4      '       dm   \        P                  P                  V4      '       gH   \        P                  P                  \        P                  P                  V P                  4      V4      pV\        VR4      3# )z(Hook called on a filename to be sourced.r   Zri)	r   r   r	   osZpathZisabsZjoinZdirnameZopen)r!   r,   r)   r"   r4   Zshlex.sourcehook  su    1:amG dkk3''g0F0Fggll277??4;;#?IGgs+,,r$   c                sV    Vf   V P                   pVf   V P                  pRW3,          # )z<Emit a C-compiler-like, Emacs-friendly error-message leader.z"%s", line %d: )r   r   )r!   r   r   r-   r"   error_leaderZshlex.error_leader'  s,    >[[F>[[F"f%555r$   c                s    V # N r0   r1   r"   __iter__Zshlex.__iter__/  s    r$   c                sR    V P                  4       pWP                  8X  d   \        hV# r:   )r5   r   ZStopIteration)r!   r   s   & r"   __next__Zshlex.__next__2  s#     HHr$   )r   r   r   r   r   r   r   r   r
   r   r   r   r   r   r   r   r   r   r   r   r    r   )NNFFr:   )NN)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r#   r*   r.   r2   r5   r3   r4   r9   r<   r=   ZnextZ__static_attributes__Z__classdictcell__)Z__classdict__s   @r"   r   r      sF     >1f&H@Tl-6 Dr$   r   )
r>   r8   r   Zcollectionsr   Zior   Ztypingr   r   r;   r$   r"   <module>r?      s'    ? 
 
   e er$   