mirror of https://github.com/kdl-org/kdl.git
reserve # so stuff like serde can use it for, say, indexing into values
This commit is contained in:
parent
6113d727d9
commit
7ec15b7a04
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue