From 7ec15b7a047931e1368e9d3d31649714791ba371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Sun, 13 Dec 2020 20:45:28 -0800 Subject: [PATCH] reserve # so stuff like serde can use it for, say, indexing into values --- README.md | 2 +- src/parser.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index efb62c1..8f66807 100644 --- a/README.md +++ b/README.md @@ -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' diff --git a/src/parser.rs b/src/parser.rs index 66c1fea..d822424 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -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,