Closed LeXofLeviafan closed 3 years ago
@LeXofLeviafan I'm not actively using EDN any more, so I don't know if I'll get around to this. In the meanwhile, pull requests are welcome.
To summary, there are three different issues here:
Char
-like classI believe this was fixed by the reporter @LeXofLeviafan in https://github.com/swaroopch/edn_format/pull/56
Oops, the third case remains open. So reopened.
The character values (like \space) are parsed as strings, which is how they are normally represented is Python code anyway. However, there are two (in broad sense) issues with your current implementation (PyPI version).
The first issue is that a lot of character literals are simply unsupported; more specifically (comparing with default edn implementation in Clojure, clojure.edn/read-string):
In general, Clojure edn parser seems to behave thus, upon encountering backslash:
The second issue is that there is no way to emit character values with dumps(). Proposed solution would be providing a corresponding class for that specific purpose (named, for example, Char); alternatively, it might be used for reading as well, to keep type information (in this case, class probably should be extending str to keep backward-compatibility).