diff options
author | Kenn Knowles <kenn.knowles@gmail.com> | 2013-06-14 18:07:26 -0400 |
---|---|---|
committer | Kenn Knowles <kenn.knowles@gmail.com> | 2013-06-14 18:07:26 -0400 |
commit | f4281ba927238bd5cbf356482c9dbf4cb328cddd (patch) | |
tree | 387f77a8b2226c9f9964ad6613d596e813a33a01 | |
parent | f8e2c27f4f744444c85911499422b4f024813f2b (diff) | |
download | jsonpath-rw-f4281ba927238bd5cbf356482c9dbf4cb328cddd.tar.gz |
Add one-off parsing rule for `parent` named operator
-rw-r--r-- | jsonpath_rw/parser.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/jsonpath_rw/parser.py b/jsonpath_rw/parser.py index d8bd6a6..fe5a6cb 100644 --- a/jsonpath_rw/parser.py +++ b/jsonpath_rw/parser.py @@ -95,6 +95,8 @@ class JsonPathParser(object): "jsonpath : NAMED_OPERATOR" if p[1] == 'this': p[0] = This() + elif p[1] == 'parent': + p[0] = Parent() else: raise Exception('Unknown named operator `%s` at %s:%s' % (p[1], p.lineno(1), p.lexpos(1))) |