/usr/lib/rads/venv/lib/python3.13/site-packages/jmespath/__pycache__
NameSizeModeActions
ast.cpython-313.pyc33270644editdlrm
compat.cpython-313.pyc8450644editdlrm
exceptions.cpython-313.pyc66080644editdlrm
functions.cpython-313.pyc154070644editdlrm
lexer.cpython-313.pyc97110644editdlrm
parser.cpython-313.pyc261220644editdlrm
visitor.cpython-313.pyc150210644editdlrm
__init__.cpython-313.pyc7890644editdlrm
Edit: /usr/lib/rads/venv/lib/python3.13/site-packages/jmespath/__pycache__/parser.cpython-313.pyc (26122B)
jJSrSSKrSSKJr SSKJr SSKJr SSKJr SSKJr "SS \ 5r \"S S \ 55r g) aTop down operator precedence parser. This is an implementation of Vaughan R. Pratt's "Top Down Operator Precedence" parser. (http://dl.acm.org/citation.cfm?doid=512927.512931). These are some additional resources that help explain the general idea behind a Pratt parser: * http://effbot.org/zone/simple-top-down-parsing.htm * http://javascript.crockford.com/tdop/tdop.html A few notes on the implementation. * All the nud/led tokens are on the Parser class itself, and are dispatched using getattr(). This keeps all the parsing logic contained to a single class. * We use two passes through the data. One to create a list of token, then one pass through the tokens to create the AST. While the lexer actually yields tokens, we convert it to a list so we can easily implement two tokens of lookahead. A previous implementation used a fixed circular buffer, but it was significantly slower. Also, the average jmespath expression typically does not have a large amount of token so this is not an issue. And interestingly enough, creating a token list first is actually faster than consuming from the token iterator one token at a time. N)lexer)with_repr_method)ast) exceptions)visitorc\rSrSr0SS_SS_SS_SS_SS_SS_S S_S S_S S_S S_S S_SS_SS_SS_SS_SS_SS_SSSSSSSSSSSSS . ErS!r0rS"rSXS#jrS$r S%r S&r SYS'jr S(r S)rS*rS+rS,rS-rS.rS/rS0rS1rS2rS3rS4rS5rS6rS7rS8rS9rS:rS;r S<r!S=r"S>r#S?r$S@r%SAr&SBr'SCr(SDr)SEr*SFr+SGr,SHr-SIr.SJr/SKr0SZSMjr1SNr2SOr3SPr4SQr5SRr6SSr7STr8SUr9\:SV5r;SWrparse Parser.parseTs`,  Mz2 "/ J t{{ dnn ,  $ $ &rAcURU5$![Ra nXleSnAf[RanUR U5 eSnAf[R a nXleSnAff=frC)_parser LexerErrorrJIncompleteExpressionErrorset_expression ParseError)r<rJes r>rFParser._do_parse^sk ;;z* *$$ %L 33   Z ( $$ %L  s*A:.A:AA:.A55A:cd[R"5RU5Ul[ UR5UlSUlURSS9nUR5S:Xd9URS5n[R"USUSUSSUS-5e[X5$)Nr) binding_powerr startvaluetypezUnexpected token: %s) rLexertokenizer8listr9r; _expression_current_token_lookahead_tokenrrT ParsedResult)r<rJparsedts r>rP Parser._parseks// ;DNN+  !!!2""$-%%a(A''' AgJ& (>7(KM MJ//rAcURS5nUR5 [USUS-UR5nU"U5nUR 5nXR U:ar[USU-S5nUc#URS5nUR U5 O(UR5 U"U5nUR 5nXR U:aMrU$)Nrz _token_nud_%sr[z _token_led_%s)ra_advancegetattr_error_nud_tokenr` BINDING_POWER_error_led_token)r<rX left_token nud_functionleft current_tokenled error_tokens r>r_Parser._expressionvs**1-   /Jv$66  ! !# J'++- 00??$- ?FC{"33A6 %%k2 4y $ 3 3 5 00?? rAc4[R"US5$NrZ)rrr<tokens r>_token_nud_literalParser._token_nud_literals{{5>**rAc4[R"US5$rt)rfieldrus r>_token_nud_unquoted_identifier%Parser._token_nud_unquoted_identifiersyyw((rAc[R"US5nUR5S:Xa0URS5n[R "SUSUSS5eU$)NrZr3rr[z1Quoted identifier not allowed for function names.)rrzr`rarrT)r<rvrzrds r>_token_nud_quoted_identifier#Parser._token_nud_quoted_identifierse %.)    H ,%%a(A''1W:qyCE E rAc[R"5nUR5S:Xa[R"5nOURURS5n[R "X#5$)Nrr-)ridentityr`_parse_projection_rhsrjvalue_projectionr<rvrnrights r>_token_nud_starParser._token_nud_starsU||~    J .LLNE..t/A/A&/IJE##D00rAcJUR[R"55$rC)_token_led_filterrrrus r>_token_nud_filterParser._token_nud_filters%%clln55rAc"UR5$rC)_parse_multi_select_hashrus r>_token_nud_lbraceParser._token_nud_lbraces,,..rAcHUR5nURS5 U$)Nr)r__matchr<rvrJs r>_token_nud_lparenParser._token_nud_lparens"%%'  HrAc[R"[R"55nURURS5n[R "X#5$Nr,)rr,rrrj projectionrs r>_token_nud_flattenParser._token_nud_flattensC{{3<<>***   y )+~~d**rAcjURURS5n[R"U5$)Nr0)r_rjrnot_expression)r<rvexprs r>_token_nud_notParser._token_nud_nots. 2 25 9:!!$''rAcUR5S;a5UR5nUR[R"5U5$UR5S:Xa}UR S5S:XahUR 5 UR 5 URURS5n[R"[R"5U5$UR5$)Nrrr-rr) r`_parse_index_expression_project_if_slicerr _lookaheadrgrrjr_parse_multi_select_list)r<rvrs r>_token_nud_lbracketParser._token_nud_lbrackets    $7 7002E ))#,,.%@ @  "f ,"j0 MMO MMO..t/A/A&/IJE>>#,,.%8 8002 2rAc URS5S:XdURS5S:XaUR5$[R"UR S5S5nUR 5 UR S5 U$)NrrrrZr)r_parse_slice_expressionrindexrargr)r<nodes r>rParser._parse_index_expressionso OOA ' )"g-//1 199T2215g>?D MMO KK #KrAc/SQnSnUR5nUS:XdUS:aUS:Xa=US- nUS:Xa!URURS5S5 UR5 ONUS:Xa'URS5S X'UR5 O!URURS5S5 UR5nUS:XdUS:aMUR S5 [ R "U6$) N)NNNrrrrr syntax errorrrZ)r`_raise_parse_error_for_tokenrargrrslice)r<partsrros r>rParser._parse_slice_expressions#++- :-%!)' A:55--a0.B (*#44Q7@  11))!,n> //1M :-%!) Jyy%  rAc,[R"5$rC)r current_noderus r>_token_nud_currentParser._token_nud_currents!!rAcjURURS5n[R"U5$)Nr)r_rjrrrs r>_token_nud_exprefParser._token_nud_exprefs,%%d&8&8&BC zz*%%rAcZUR5S:XdTURURS5nUSS:XaUSRU5 U$[R "X/5$UR 5 URURS5n[R"X5$)Nr-r/r[ subexpressionchildren) r`_parse_dot_rhsrjappendrrrgrrr<rnrs r>_token_led_dotParser._token_led_dots""$.''(:(:5(ABEF|.Z ''. (($77 MMO..""5)+E''4 4rAcjURURS5n[R"X5$)Nr)r_rjrrrs r>_token_led_pipeParser._token_led_pipes,  !3!3F!;<xx$$rAcjURURS5n[R"X5$)Nr)r_rjr or_expressionrs r> _token_led_orParser._token_led_or s.  !3!3D!9:  --rAcjURURS5n[R"X5$)Nr)r_rjrand_expressionrs r>_token_led_andParser._token_led_and s.  !3!3E!:;!!$..rAcUSS:wa9URS5n[R"USUSUSSUS-5eUSn/nUR5S:Xd\UR 5nUR5S:XaUR S5 UR U5 UR5S:XdM\UR S5 [R"X45nU$) Nr[rzrYrZzInvalid function name '%s'rr) rarrTr`r_rrrfunction_expression)r<rnprev_tnameargsrJ function_nodes r>_token_led_lparenParser._token_led_lparens <7 "**2.F''w&.,vg>@ @G}%%'83))+J""$/ G$ KK # %%'83 H//; rAcURS5nURS5 UR5S:Xa[R"5nOUR UR S5n[R"XU5$)Nrrr,r.)r_rr`rrrrjfilter_projection)r<rn conditionrs r>rParser._token_led_filter%sh$$Q'  J    I -LLNE..t/A/A(/KLE$$T)< _token_led_eqParser._token_led_eq/%%dD11rAc&URUS5$)Nr+rrs r> _token_led_neParser._token_led_ne2rrAc&URUS5$)Nrrrs r> _token_led_gtParser._token_led_gt5rrAc&URUS5$)Nr)rrs r>_token_led_gteParser._token_led_gte8%%dE22rAc&URUS5$)Nr(rrs r> _token_led_ltParser._token_led_lt;rrAc&URUS5$)Nr*rrs r>_token_led_lteParser._token_led_lte>rrAc[R"U5nURURS5n[R"X5$r)rr,rrjrrs r>_token_led_flattenParser._token_led_flattenAs={{4 **   y )+~~d**rAcbURS5nUSS;a@UR5nUSS:XaUSRU5 U$URX5$UR S5 UR S5 UR UR S5n[R"X5$)Nrr[rindex_expressionrr-r) rarrrrrrjrr)r<rnrvrs r>_token_led_lbracketParser._token_led_lbracketGs%%a( =/ /002EF|11Z ''. --d:: KK  KK #..t/A/A&/IJE>>$. .rAc[R"X/5nUSS:Xa3[R"UURURS55$U$)Nr[rr-)rrrrrj)r<rnr index_exprs r>rParser._project_if_sliceZsW))4-8 =G #>>**4+=+=f+EFH H rAclURURU5n[R"X!U5$rC)r_rjr comparator)r<rnrrs r>rParser._parse_comparatorcs.  !3!3J!?@~~j66rAc/nUR5nURU5 UR5S:XaOURS5 MIURS5 [R "U5$)Nrr)r_rr`rrmulti_select_list)r< expressionsrJs r>rParser._parse_multi_select_listgsj ))+J   z *""$ 2 G$  J$$[11rAc/nURS5nURSS/S9 USnURS5 URS5n[R "X4S9nUR U5 UR5S:XaURS5 O&UR5S :XaURS 5 OM[R"US 9$) Nrr r ) token_typesrZr)key_namerrr)nodes) ra_match_multiple_tokensrr_r key_val_pairrr`multi_select_dict)r<pairs key_tokenrrZrs r>rParser._parse_multi_select_hashss--a0I  ' '02GH ( J )H KK $$Q'E##XBD LL ""$/ G$$$&(2 H% $$511rAcURUR5UR:a[R"5nU$UR5S:XaUR U5nU$UR5S:XaUR U5nU$UR5S:Xa$UR S5 URU5nU$URURS5S5 W$)Nr2r.r/rr) rjr`_PROJECTION_STOPrrr_rrrra)r<rXrs r>rParser._parse_projection_rhss   d113 4t7L7L LLLNE  "j 0$$]3E  "h .$$]3E  "e + KK '' 6E   - -d.C.CA.F.< > rAcTUR5nUS;aURU5$US:Xa!URS5 UR5$US:Xa!URS5 UR 5$UR S5n/SQnSU<SUS<3nUR X55 g) N)r r r-r2r1r)r r r2r1 Expecting: , got: r[)r`r_rrrrar)r<rXr=rdallowedmsgs r>rParser._parse_dot_rhss'') L L##M2 2 * $ KK #002 2 ( " KK !002 2%%a(A-G-4QvY?   - -a 5rAc|USS:Xa![R"USUSUS5eURUS5 g)Nr[r rYrZ invalid token)rrRrrus r>riParser._error_nud_tokensD =E !66ggf ? ? ))%ArAc(URUS5 g)Nr)rrus r>rkParser._error_led_tokens ))%ArANcUR5U:XaUR5 gURXRS55 gr7)r`rg_raise_parse_error_maybe_eofra)r< token_types r>r Parser._matchs8    J . MMO  - -11!4 6rAcUR5U;a URXRS55 UR5 gr7)r`rrarg)r<rs r>rParser._match_multiple_tokenss8    3  - -2215 7 rAc.U=RS- slg)Nr)r;r<s r>rgParser._advances q rAc:URURS$Nr[r9r;r s r>r`Parser._current_tokens||DKK(00rAc@URURU-S$r#r$r<rs r>rParser._lookaheads||DKK&01&99rAc:URURU-$rCr$r's r>raParser._lookahead_tokens||DKK&011rAcNUSnUSnUSn[R"X4XR5e)NrYrZr[)rrT)r<rvreason lex_position actual_value actual_types r>r#Parser._raise_parse_error_for_tokens5W~ W~ Fm ##L$/9 9rAcUSnUSnUSnUS:Xa[R"X4U5eSU<SU<3n[R"X4XV5e)NrYrZr[r rr)rrRrT)r< expected_typervr-r.r/messages r>r#Parser._raise_parse_error_maybe_eofsiW~ W~ Fm % 66K9 9 /<.9;##  > >rAc[R"[URR 55[ UR S- 55HnURRUS5 M! g)Nr)randomsampler^rDkeysintrHpop)r<keys r>rIParser._free_cache_entriessK==dkk&6&6&8!93t~~PQ?Q;RSC KKOOC &TrAc8URR5 g)z'Clear the expression compilation cache.N)rDclear)clss r>purge Parser.purges rA)r:r;r9r8)r)rrC)=__name__ __module__ __qualname____firstlineno__rjr rDrHr?rMrFrPr_rwr{r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrirkrrrgr`rrarrrI classmethodr@__static_attributes__rAr>r r %s! qq Q 1  A  !   ! ! 1 !   a q a!" a#$=MDFI   0&+) 16/ + (3" !0"& 5%./(=222323+ /&7 22("68B B6 1:29 >'rAr c0\rSrSrSrSSjrSrSrSrg) rbicXlX lgrCrJrc)r<rJrcs r>r?ParsedResult.__init__s $ rANcj[R"U5nURURU5nU$rC)rTreeInterpretervisitrc)r<rZoptions interpreterresults r>searchParsedResult.searchs---g6 ""4;;6 rAcf[R"5nURUR5nU$)a6Render the parsed AST as a dot file. Note that this is marked as an internal method because the AST is an implementation detail and is subject to change. This method can be used to help troubleshoot or for development purposes, but is not considered part of the public supported API. Use at your own risk. )rGraphvizVisitorrOrc)r<renderercontentss r>_render_dot_fileParsedResult._render_dot_files)**,>>$++.rAc,[UR5$rC)reprrcr s r>__repr__ParsedResult.__repr__sDKK  rArKrC) rBrCrDrEr?rSrYr]rGrHrAr>rbrbs !rArb) __doc__r6jmespathrjmespath.compatrrrrobjectr rbrHrAr>rcsH6,MVM`!6!!rA