diff --git a/edn/src/edn.rustpeg b/edn/src/edn.rustpeg index 2a642bea..5f97ea6d 100644 --- a/edn/src/edn.rustpeg +++ b/edn/src/edn.rustpeg @@ -146,7 +146,7 @@ namespace_separator = "/" // Keywords follow the rules of symbols, except they can (and must) begin with : // e.g. :fred or :my/fred. See https://github.com/edn-format/edn#keywords symbol_char_initial = [a-zA-Z0-9*!_?$%&=<>] -symbol_char_subsequent = [a-zA-Z0-9*!_?$%&=<>-] +symbol_char_subsequent = [+a-zA-Z0-9*!_?$%&=<>-] symbol_namespace = symbol_char_initial symbol_char_subsequent* (namespace_divider symbol_char_subsequent+)* symbol_name = ( symbol_char_initial+ symbol_char_subsequent* ) diff --git a/edn/tests/tests.rs b/edn/tests/tests.rs index d9dc9380..54cf87b0 100644 --- a/edn/tests/tests.rs +++ b/edn/tests/tests.rs @@ -413,6 +413,9 @@ fn test_keyword() { assert!(keyword(":").is_err()); assert!(keyword(":foo/").is_err()); + + assert_eq!(keyword(":foo*!_?$%&=<>-+").unwrap(), k_plain("foo*!_?$%&=<>-+")); + assert_eq!(keyword(":foo/bar*!_?$%&=<>-+").unwrap(), k_ns("foo", "bar*!_?$%&=<>-+")); } #[test]