- changed status to resolved
< and > should be included in symbols
Issue #1
closed
The EDN spec missed this, but the omission has since been corrected:
https://github.com/edn-format/edn/issues/62
https://github.com/edn-format/edn/commit/a51127aecd318096667ae0dafa25353ecb07c9c3
The following change seems to help:
diff --git a/src/Data/EDN/Parser.hs b/src/Data/EDN/Parser.hs
index a307a47..3de4c16 100644
--- a/src/Data/EDN/Parser.hs
+++ b/src/Data/EDN/Parser.hs
@@ -128,27 +128,27 @@ parseCharacter = do
parseSymbol :: Parser Value
parseSymbol = do
skipSoC
- c <- satisfy (inClass "a-zA-Z.*/!?$%&=+_-")
+ c <- satisfy (inClass "a-zA-Z.*/!?$%&=+_<>-")
(ns, val) <- withNS c <|> withoutNS c
return $! Symbol ns val
where
withNS c = do
- ns <- takeWhile (inClass "a-zA-Z0-9#:.*!?$%&=+_-")
+ ns <- takeWhile (inClass "a-zA-Z0-9#:.*!?$%&=+_<>-")
char '/'
- vc <- satisfy (inClass "a-zA-Z.*/!?$%&=+_-")
- val <- takeWhile1 (inClass "a-zA-Z0-9#:.*!?$%&=+_-")
+ vc <- satisfy (inClass "a-zA-Z.*/!?$%&=+_<>-")
+ val <- takeWhile1 (inClass "a-zA-Z0-9#:.*!?$%&=+_<>-")
return (c `BS.cons` ns, vc `BS.cons` val)
withoutNS c = do
- val <- takeWhile (inClass "a-zA-Z0-9#:.*!?$%&=+_-")
+ val <- takeWhile (inClass "a-zA-Z0-9#:.*!?$%&=+_<>-")
return ("", c `BS.cons` val)
parseKeyword :: Parser Value
parseKeyword = do
skipSoC
char ':'
- c <- satisfy (inClass "a-zA-Z.*/!?$%&=+_-")
- x <- takeWhile (inClass "a-zA-Z0-9#:.*/!?$%&=+_-")
+ c <- satisfy (inClass "a-zA-Z.*/!?$%&=+_<>-")
+ x <- takeWhile (inClass "a-zA-Z0-9#:.*/!?$%&=+_<>-")
return $! Keyword (c `BS.cons` x)
parseNumber :: Parser Value
Comments (2)
-
repo owner -
repo owner - changed status to closed
Thanks!
- Log in to comment
Add
<>
to symbol and keyword parsersFixes
#1.→ <<cset 79d50230d87b>>