mirror of https://github.com/status-im/edn.nim.git
fix: reading unicode chars + tests
This commit is contained in:
parent
fe1685b4b6
commit
e0968b3b7d
|
@ -425,7 +425,7 @@ proc read_character(p: var EdnParser): EdnNode =
|
|||
elif token == "return":
|
||||
result.character = "\r"
|
||||
elif token.startsWith("u"):
|
||||
result.character = parse_hex_str(token)
|
||||
result.character = parse_hex_str(token.substr(1))
|
||||
elif token.startsWith("o"):
|
||||
# TODO: impl unicode char reading
|
||||
raise new_exception(ParseError, "Not implemented: reading unicode chars")
|
||||
|
|
|
@ -317,6 +317,12 @@ test "everything":
|
|||
except ParseError:
|
||||
discard
|
||||
|
||||
node = read("\"\uffff\"")
|
||||
check node.kind == EdnString
|
||||
|
||||
node = read("\\uffff")
|
||||
check node.kind == EdnCharacter
|
||||
|
||||
node = read("()") # for the following to work
|
||||
var n1: EdnNode = EdnNode(kind: EdnNil)
|
||||
var n2: EdnNode = EdnNode(kind: EdnNil)
|
||||
|
|
Loading…
Reference in New Issue