This repository was archived by the owner on Feb 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -11,30 +11,30 @@ use serde_json::Value;
11
11
/// For example, the JSONPath `$.foo.bar` yields this AST:
12
12
///
13
13
/// ```text
14
- /// ^
15
- /// / \
16
- /// ^ \___ DotName("bar")
17
- /// / \
18
- /// ^ \___ DotName("foo")
19
- /// /
20
- /// Root ___/
14
+ /// ^
15
+ /// / \
16
+ /// ^ \___ DotName("bar")
17
+ /// / \
18
+ /// Root ___ / \___ DotName("foo")
21
19
/// ```
22
20
///
23
21
/// A more complicated example: `$.foo[1,2]["bar"]`:
24
22
///
25
23
/// ```text
26
- /// ^
27
- /// / \
28
- /// ^ \___ Union
29
- /// / \ \
30
- /// ^ \___ Union \
31
- /// / \ [Field("bar")]
32
- /// ^ \
33
- /// / \ [Number(1), Number(2)]
34
- /// / \
35
- /// Root ___/ \___ DotName("foo")
24
+ /// ^
25
+ /// / \
26
+ /// ^ \___ Union
27
+ /// / \ \
28
+ /// / \___ Union \___ [Field("bar")]
29
+ /// / \
30
+ /// ^ \___ [Number(1), Number(2)]
31
+ /// / \
32
+ /// Root ___/ \___ DotName("foo")
36
33
/// ```
37
34
///
35
+ /// Selectors are left associative, thus `$.foo[1,2]["bar"]` behaves
36
+ /// like (pseudocode) `(($.foo)[1,2])["bar"]`; thus the root of the resulting
37
+ /// tree is actually the right-most selector (the last one to be applied).
38
38
#[ derive( Debug ) ]
39
39
pub enum Path {
40
40
Root ,
You can’t perform that action at this time.
0 commit comments