The breaking changes affecting this library are:
* Macro arguments of type typedesc are now passed to the macro as
NimNode like every other type except static. Use typed for a behavior
that is identical in new and old Nim. See the RFC Pass typedesc as
NimNode to macros for more details.
(https://github.com/nim-lang/RFCs/issues/148)
* case object branch transitions via system.reset are deprecated.
Compile your code with -d:nimOldCaseObjects for a transition period.
The solution here is to compile with '-d:nimOldCaseObjects' for the
time being. I didn't understand how to modify the code to adhere to
the new way of initializing/changing variant objects.
* The compiler now enforces range checking which exposed a bug in the
fieldCount proc. For variant objects where one of the branches is
given on one line, e.g.
...
of akDog: barkometer: int
...
the field wasn't counted and the total field count was not accurate.
Extens the `Level` type in `tojson` by a `expKey` field, which is used
to indicate whether a node still expects a key or not.
NOTE: not sure if the `expKey = true` statements in lines 163 and 183
are necessary / correct. Tests work this way though.
Since the null terminator is not available anymore we need to be
careful how we access strings in the lexer.
This should probably be solved in a nicer and more scalable way! :/
Converting an integer via `T(number)` to some integer will cause a
range error, if it doesn't fit. Maybe it didn't in the past, which is
why the code worked before? Some other error was thrown?
With this code anyway it crashed, because it threw an internal error.
61720e0df9475af647de171f6b2964c36234961a in the Nim compiler introduced the bug
in this project. In brief, the upstream change flattens `nnkStmtList`s of one
item. Thus, `quote do:` followed by one statement is no longer a nnkStmtList
but whatever that one statement is. This breaks several macro implementations
where a `quote do:` form is initialized and then appended to. Based on Araq's
feedback (https://irclogs.nim-lang.org/02-10-2017.html#21:01:26), these
single-statement quotes are now converted into one-element statement lists as
necessary (behavior on old versions of the compiler is maintained).