Qf)4 ddlZddlZddlZddlmZddlmZgdZGddZddZ dZ ejd ejjZd Zd Zed k(rSeej&d k(reeyej&d Zee5Zeeeedddyy#1swYyxYw)N)deque)StringIO)shlexsplitquotejoincdeZdZ d dZedZdZddZdZdZ dZ d Z dd Z d Z d Zy)rNct|tr t|}|||_||_nt j |_d|_||_|rd|_nd|_d|_ d|_ |jr|xjdz c_ d|_ d|_ d|_ d|_d |_d |_t#|_d |_d |_d|_t#|_d|_|sd}n|d urd}||_|rst#|_|xjdz c_ |jj5t6j9|}|jj;||_ yy)N#?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz Fz'"\" rTz();<>|&z~-./*?=) isinstancestrrinstreaminfilesysstdinposixeof commenters wordchars whitespacewhitespace_splitquotesescape escapedquotesstaterpushbacklinenodebugtoken filestacksource_punctuation_chars_pushback_chars maketransdictfromkeys translate)selfrrrpunctuation_charsts ,/opt/alt/python312/lib64/python3.12/shlex.py__init__zshlex.__init__sN h $)H  $DM DKIIDMDK DHDHB :: NN ^ _N# %          "  $ & ) "3 #(7D NNi 'N((7H)IJA!^^55a8DN c|jSN)r(r.s r1r/zshlex.punctuation_charsDs&&&r3c |jdk\rtdt|z|jj |y)Nrzshlex: pushing token )r$printreprr" appendleft)r.toks r1 push_tokenzshlex.push_tokenHs4D ::? )DI5 6   %r3c^ t|tr t|}|jj |j |j |jf||_||_d|_|jr4|td|j ytd|j yy)Nrzshlex: pushing to file zshlex: pushing to stream ) rrrr&r:rrr#r$r8)r. newstreamnewfiles r1 push_sourcezshlex.push_sourceNsC i % +I !!4;; t{{"KL !  ::"T[[BCt}}FG r3c |jj|jj\|_|_|_|j r$td|j|j fzd|_y)Nzshlex: popping to %s, line %dr) rcloser&popleftrr#r$r8r!r6s r1 pop_sourcezshlex.pop_source\sb% 48NN4J4J4L1dmT[ :: 1]]DKK01 2 r3c |jrB|jj}|jdk\rtdt |z|S|j }|j g||j k(rX|j|j }|r|\}}|j|||j}||j k(rX||jk(rH|js |jS|j|j}||jk(rH|jdk\r3||jk7rtdt |z|Std|S)Nrzshlex: popping token z shlex: token=zshlex: token=EOF) r"rCr$r8r9 read_tokenr' sourcehookr@ get_tokenrr&rD)r.r;rawspecr?r>s r1rHzshlex.get_tokenes.L ==--'')CzzQ-S 9:Joo ;; "$t'89+/(Wi$$Y8nn& $TXXo>>xx!nn& TXXo ::?dhhoS 12 () r3c d}d} |jr'|jr|jj}n|jj d}|dk(r|xj dz c_|j dk\rtd|jd||j d |_ n<|jdk(r\|s d|_n!||jvr8|j d k\r td |js|jr|rnݐ ||jvr1|jj|xj dz c_n|jr||jvr d }||_nu||jvr||_ d |_nW||jvr||_ d |_n9||j vr|js||_ ||_n|j"r||_ d |_n||_ |js|jr|rnҐ|j|j vrd}|s%|j d k\r tdt%d||jk(r3|js|xj|z c_ d|_nVd |_nK|jr;||jvr-|j|j&vr|j}||_n|xj|z c_ n|j|jvr|s%|j d k\r tdt%d||j vr3||jk7r$||k7r|xj|jz c_ |xj|z c_ ||_nO|jdvr@|s d|_n7||jvr?|j d k\r tdd|_|js|jr|rn||jvra|jj|xj dz c_|jrd|_|js|jr|rn}i|jd k(rW||jvr|xj|z c_ nE||jvr|jj)|d|_n|jr||j vr||_n|jr||jvr d }||_n||jvs(||j vs|j"r$||jvr|xj|z c_ n|jr|jj)|n|j*j-||j d k\r tdd|_|js|jr|rn|j}d |_ |jr |s|d k(rd}|j dkDr&|rtdt/|z|Std|S)NFrTr zshlex: in state z I see character: r z+shlex: I see whitespace in whitespace stateacz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rOrPz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r/r)poprreadr#r$r8r!r%rrrreadlinerrrr ValueErrorr appendr"r:r9)r.quoted escapedstatenextcharresults r1rFzshlex.read_tokens  %%$*>*>//335==--a04 q zzQ$**BJLMzz! s"!%DJ0zzQKLzzdjjV 0MM**,KK1$KZZH $;#&L!)DJ/!)DJ!$DJ!7!77!)DJ!$DJ,::%- !)DJ**!)DJ!$DJ!)DJzzdjjV t{{*zzQ@A$%;<<tzz):: h. %( %( jjX%<++B,#'::L!)DJJJ(*Jt{{*zzQ@A$%;<<!DKK/ DJJ.8|3KJJ$**,J h& ) z)!%DJ0zzQEF!$DJzzdjjV 0MM**,KK1$Kzz%( ::$**!$ZZ3&4#9#99 h. #4??: 0077A%( ZZH $;!)DJZZH $;#&L!)DJ$..0H 4K//"$*@*@@JJ(*J--,,33H= 00:zzQFG!$DJzzdjjV GH ::f2F ::>)DL89 ,- r3c: |ddk(r|dd}t|jtrftjj |sGtjj tjj|j|}|t|dfS)Nrrrr) rrrospathisabsrdirnameopen)r.r?s r1rGzshlex.sourcehooksp2 1: amG dkk3 ' g0Fggll277??4;;#?IGgs+,,r3cJ | |j}| |j}d||fzS)Nz"%s", line %d: )rr#)r.rr#s r1 error_leaderzshlex.error_leader s1F >[[F >[[F"ff%555r3c|Sr5r6s r1__iter__zshlex.__iter__(s r3cP|j}||jk(rt|Sr5)rHr StopIteration)r.r%s r1__next__zshlex.__next__+s%  DHH   r3)NNFFr5)NN)__name__ __module__ __qualname__r2propertyr/r<r@rDrHrFrGrcrfrirer3r1rrsV>9>#(-9^''& H@Pd-6r3rcn | tdt||}d|_|sd|_t |S)Nzs argument must not be None)rTr )rTrrrlist)scommentsrlexs r1rr1s>7y677  CC  9r3c4 djd|DS)Nrc32K|]}t|ywr5)r).0args r1 zjoin..>s8-3E#J-s)r) split_commands r1rr<s= 888-8 88r3z[^\w@%+=:,./-]cT |syt||Sd|jddzdzS)Nz'''z'"'"') _find_unsafereplace)rps r1rrCs7; A 3 * *S 00r3c~|jx}r+tdt|z|jx}r*yy)NzToken: )rHr8r9)lexertts r1 _print_tokensrOs9! !" ! i$r("#! !" !r3__main__r)FT)r]rer collectionsrior__all__rrrcompileASCIIsearchr{rrrjlenargvfnrafrer3r1rs>  -\\|9 rzz+RXX6==  1$ z 388}eg XXa[ "X %2, 'X  Xs B55B>