reserve # so stuff like serde can use it for, say, indexing into values

This commit is contained in:
Kat Marchán 2020-12-13 20:45:28 -08:00
parent 6113d727d9
commit 7ec15b7a04
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ node-argument := prop | value
node-children := '{' nodes '}'
node-space := ws* escline ws* | ws+
identifier := [a-zA-Z] [a-zA-Z0-9!#$%&'*+\-./:<>?@\^_|~]* | string
identifier := [a-zA-Z] [a-zA-Z0-9!$%&'*+\-./:<>?@\^_|~]* | string
prop := identifier '=' value
value := string | raw_string | number | boolean | 'null'

View File

@ -55,14 +55,14 @@ pub(crate) fn node(input: &str) -> IResult<&str, Node, KdlParseError<&str>> {
))
}
/// `identifier := [a-zA-Z_] [a-zA-Z0-9!#$%&'*+\-./:<>?@\^_|~]* | string`
/// `identifier := [a-zA-Z_] [a-zA-Z0-9!$%&'*+\-./:<>?@\^_|~]* | string`
fn identifier(input: &str) -> IResult<&str, &str, KdlParseError<&str>> {
alt((
recognize(pair(
alt((alpha1, tag("_"))),
many0(alt((
alphanumeric1,
recognize(one_of("~!@#$%^&*-_+./:<>?")),
recognize(one_of("~!@$%^&*-_+./:<>?")),
))),
)),
string,