diff --git a/src/grammar.pest b/src/grammar.pest index 30b93a3..8b4e767 100644 --- a/src/grammar.pest +++ b/src/grammar.pest @@ -10,7 +10,11 @@ wildcardedDotChild = { ".*" } namedDotChild = ${ "." ~ childName } childName = @{ char+ } char = { - !("\"" | "'" | "\\") ~ ANY // char is still TBD in the draft + "-" + | ASCII_DIGIT + | ASCII_ALPHA + | "_" + | '\u{80}'..'\u{10FFFF}' } union = { "[" ~ unionElement ~ ("," ~ unionElement)* ~ "]" } diff --git a/tests/cts.json b/tests/cts.json index 7254d26..842118c 100644 --- a/tests/cts.json +++ b/tests/cts.json @@ -10,6 +10,15 @@ "document": {"a" : "A", "b" : "B"}, "result": ["A"] }, { + "name": "dot child, ☺ name", + "selector": "$.☺", + "document": {"☺" : "A", "b" : "B"}, + "result": ["A"] + }, { + "name": "dot child, invalid character", + "selector": "$.&", + "invalid_selector": true + }, { "name": "dot child absent", "selector": "$.c", "document": {"a" : "A", "b" : "B"},