Allow plus symbol "+" in symbol names. (#821) r=nalexander
This commit is contained in:
parent
e3113783ae
commit
fba9568d44
2 changed files with 4 additions and 1 deletions
|
@ -146,7 +146,7 @@ namespace_separator = "/"
|
||||||
// Keywords follow the rules of symbols, except they can (and must) begin with :
|
// 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
|
// e.g. :fred or :my/fred. See https://github.com/edn-format/edn#keywords
|
||||||
symbol_char_initial = [a-zA-Z0-9*!_?$%&=<>]
|
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_namespace = symbol_char_initial symbol_char_subsequent* (namespace_divider symbol_char_subsequent+)*
|
||||||
symbol_name = ( symbol_char_initial+ symbol_char_subsequent* )
|
symbol_name = ( symbol_char_initial+ symbol_char_subsequent* )
|
||||||
|
|
|
@ -413,6 +413,9 @@ fn test_keyword() {
|
||||||
|
|
||||||
assert!(keyword(":").is_err());
|
assert!(keyword(":").is_err());
|
||||||
assert!(keyword(":foo/").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]
|
#[test]
|
||||||
|
|
Loading…
Reference in a new issue