Never convert Preserves symbols to Nim strings!
This commit is contained in:
parent
9fa6685071
commit
47e7851beb
|
@ -1,6 +1,6 @@
|
|||
# Package
|
||||
|
||||
version = "20230612"
|
||||
version = "20230720"
|
||||
author = "Emery Hemingway"
|
||||
description = "data model and serialization format"
|
||||
license = "Unlicense"
|
||||
|
|
|
@ -1057,15 +1057,9 @@ proc fromPreserve*[T, E](v: var T; pr: Preserve[E]): bool =
|
|||
v = (T)pr.int
|
||||
result = true
|
||||
elif T is string:
|
||||
case pr.kind
|
||||
of pkString:
|
||||
if pr.kind == pkString:
|
||||
v = pr.string
|
||||
result = true
|
||||
of pkSymbol:
|
||||
# loose convertability of Preserves symbol to Nim string
|
||||
v = string pr.symbol
|
||||
result = true
|
||||
else: discard
|
||||
elif T is Symbol:
|
||||
if pr.kind == pkSymbol:
|
||||
v = pr.symbol
|
||||
|
|
Loading…
Reference in New Issue