8000 Add one-off parsing rule for `parent` named operator · 0xdecaf/python-jsonpath-rw@f4281ba · GitHub
[go: up one dir, main page]

Skip to content

Commit f4281ba

Browse files
committed
Add one-off parsing rule for parent named operator
1 parent f8e2c27 commit f4281ba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

jsonpath_rw/parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ def p_jsonpath_named_operator(self, p):
9595
"jsonpath : NAMED_OPERATOR"
9696
if p[1] == 'this':
9797
p[0] = This()
98+
elif p[1] == 'parent':
99+
p[0] = Parent()
98100
else:
99101
raise Exception('Unknown named operator `%s` at %s:%s' % (p[1], p.lineno(1), p.lexpos(1)))
100102

0 commit comments

Comments
 (0)
0