/usr/lib/rads/venv/lib/python3.13/site-packages/jmespath/__pycache__
Edit: /usr/lib/rads/venv/lib/python3.13/site-packages/jmespath/__pycache__/parser.cpython-313.pyc (26122B)
jJ S r SSKrSSKJr SSKJr SSKJr SSKJr SSKJr " S S \ 5 r
\ " S
S\ 5 5 rg)a Top 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 \ rS rSr0 SS_SS_SS_SS_SS_SS_S S_S
S_SS_SS_S
S_SS_SS_SS_SS_SS_SS_SSSSSSSSSSSSS .ErS!r0 rS"rSXS# jrS$ r S% r
S& rSYS' jrS( r
S) rS* rS+ rS, rS- rS. rS/ rS0 rS1 rS2 rS3 rS4 rS5 rS6 rS7 rS8 rS9 rS: rS; r S< r!S= r"S> r#S? r$S@ r%SA r&SB r'SC r(SD r)SE r*SF r+SG r,SH r-SI r.SJ r/SK r0SZSM jr1SN r2SO r3SP r4SQ r5SR r6SS r7ST r8SU r9\:SV 5 r;SWr