Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 644ddc9

Browse files
author
Marko Mikulicic
committed
Fix diagram
1 parent eca69d8 commit 644ddc9

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/ast.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@ use serde_json::Value;
1111
/// For example, the JSONPath `$.foo.bar` yields this AST:
1212
///
1313
/// ```text
14-
/// ^
15-
/// / \
16-
/// ^ \___ DotName("bar")
17-
/// / \
18-
/// ^ \___ DotName("foo")
19-
/// /
20-
/// Root ___/
14+
/// ^
15+
/// / \
16+
/// ^ \___ DotName("bar")
17+
/// / \
18+
/// Root ___ / \___ DotName("foo")
2119
/// ```
2220
///
2321
/// A more complicated example: `$.foo[1,2]["bar"]`:
2422
///
2523
/// ```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")
3633
/// ```
3734
///
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).
3838
#[derive(Debug)]
3939
pub enum Path {
4040
Root,

0 commit comments

Comments
 (0)