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

Commit 572e311

Browse files
authored
Merge pull request #5 from jsonpath-standard/dot-child-name-syntax
dot child name syntax
2 parents 13368a9 + 86a4836 commit 572e311

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/grammar.pest

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ wildcardedDotChild = { ".*" }
1010
namedDotChild = ${ "." ~ childName }
1111
childName = @{ char+ }
1212
char = {
13-
!("\"" | "'" | "\\") ~ ANY // char is still TBD in the draft
13+
"-"
14+
| ASCII_DIGIT
15+
| ASCII_ALPHA
16+
| "_"
17+
| '\u{80}'..'\u{10FFFF}'
1418
}
1519

1620
union = { "[" ~ unionElement ~ ("," ~ unionElement)* ~ "]" }

tests/cts.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
"document": {"a" : "A", "b" : "B"},
1111
"result": ["A"]
1212
}, {
13+
"name": "dot child, ☺ name",
14+
"selector": "$.☺",
15+
"document": {"☺" : "A", "b" : "B"},
16+
"result": ["A"]
17+
}, {
18+
"name": "dot child, invalid character",
19+
"selector": "$.&",
20+
"invalid_selector": true
21+
}, {
1322
"name": "dot child absent",
1423
"selector": "$.c",
1524
"document": {"a" : "A", "b" : "B"},

0 commit comments

Comments
 (0)