Commit Graph

446 Commits

Author SHA1 Message Date
Felix Krause 96254f1900 Fixes #80 2020-03-22 11:57:00 +01:00
flyx 9a81ae982f Version 0.13.0 2020-03-08 20:05:13 +01:00
flyx 1dfc2a3333 Implemented Option serialization. Fixes #78 2020-03-08 19:58:02 +01:00
flyx f714881ae9 Fixed submodules. Fixed some depr warnings. Fixes #77 2020-03-08 19:22:34 +01:00
Felix Krause f8b264f992 Fixes #76 2019-11-30 13:16:40 +01:00
Felix Krause e6ac75d86a Version 0.12.0 2019-09-06 16:38:21 +02:00
Hayden 20bf995ae6 Fix link to YAML 1.2 Schema 2019-09-06 16:24:45 +02:00
k0zmo 0336d06114 Disallow deserialization of object variants with multiple object branches 2019-07-06 11:14:34 +02:00
k0zmo fd4a718586 Adhere to new rules of object variants (re)initialization 2019-07-06 11:14:34 +02:00
Marcus Eriksson 90f47e1043 Only include the type name in the error message 2019-07-06 11:14:34 +02:00
Marcus Eriksson ef2b2e9ae7 Fixes for Nim v0.20.0
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.
2019-07-06 11:14:34 +02:00
Kobi 053d5d1333 removed empty lines
(probably from nimpretty formatting?)
2019-01-27 12:07:16 +01:00
Kobi Lurie 9226aa4d37 modified presenter to work with deques instead of the obsolete queues 2019-01-27 12:07:16 +01:00
Felix Krause b4936a14dd Version 0.11.0 2018-10-12 16:07:41 +02:00
Vindaar 1babb26616 move echo statement for internal stacktrace into if branch
No need to echo internal stacktrace, if there is no parent to echo for.
2018-10-12 16:00:39 +02:00
Vindaar 8a7750cb6c make sure to also append '\0' for JS as well as C backend
Also remove now unnecessary `os` (was imported for internal
`assertStringEqual` test) module import in `tserialization`.
2018-10-12 16:00:39 +02:00
Vindaar 2d47de8c4e ignore yaml test suite case 'S98Z' 2018-10-12 16:00:39 +02:00
Vindaar c4e7072722 clean up `constructJson` by removing not needed assignments
Also use `expKey` everywhere.
2018-10-12 16:00:39 +02:00
Vindaar 3eb006be2d Revert "fix for null terminator not accessable in strings anymore"
This reverts commit 07c59e2d2d90b3123973814ebc9cf974a0bf4baf.
2018-10-12 16:00:39 +02:00
Vindaar d26a57fe93 append null terminator to source when creating `StringSource`
This makes editing the lexer unnecessary.
2018-10-12 16:00:39 +02:00
Vindaar ba06599b7d echo internal stack trace if not release, check if parent is nil 2018-10-12 16:00:39 +02:00
Vindaar a211eab2c6 whitespace removal to get rid of 'number of spaces around...'
Since whitespace wasn't aligning all `==` anyways, removal seems fine.
2018-10-12 16:00:39 +02:00
Vindaar 6b429e6571 replace deprecated 'dot' import / export by '/' 2018-10-12 16:00:39 +02:00
Vindaar da9396a2f3 remove internal string assert test 2018-10-12 16:00:39 +02:00
Vindaar 06ddc9eb13 Revert "fix internal `IndexError` in `lex.nim` due to null term n.a."
This reverts commit e147df31718bb5bcd27c4067314dc40c2ecc9348.
2018-10-12 16:00:39 +02:00
Vindaar e104dc351d [tojson] extend `Level` by `expKey` to signal node expects a key
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.
2018-10-12 16:00:39 +02:00
Vindaar 407b10be66 do not construct empty seq for `yamlScalar` 2018-10-12 16:00:39 +02:00
Vindaar d19539a231 fix internal `IndexError` in `lex.nim` due to null term n.a.
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! :/
2018-10-12 16:00:39 +02:00
Vindaar 446493ded8 replace `newException` by `constructionError` call if int too large
If an integer doesn't fit into the target type an exception is thrown.
2018-10-12 16:00:39 +02:00
Vindaar db1a2c4041 allow echoing internal stacktrace if compiling with `d:debug`
`internalError` and `yAssert` now allow to echo the internal stack
traces if the `d:debug` compile flag is set.
2018-10-12 16:00:39 +02:00
Vindaar f0eeece22d remove unnecessary cast on return value of `newStringOfCap` 2018-10-12 16:00:39 +02:00
Vindaar ebe4201cbc replace `assertStringEqual` by version checking for content and len
Now check for content *and* length of the strings in
`tserialization`. Also adds a test case for the case with which the
old version would have failed (one string longer than the other, thus
being different).

This version tries to keep the error reporting mechanism the same as
the old version.
2018-10-12 16:00:39 +02:00
Vindaar 53c476ce38 remove unnecessary if branch related too seq construction
Not needed anymore, since seqs can never be nil nowadays.
2018-10-12 16:00:39 +02:00
Vindaar 81e50d73d9 remove commented out old code 2018-10-12 16:00:39 +02:00
Vindaar 253a4623e4 circumvent RangeError, which will be wrongly caught
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.
2018-10-12 16:00:39 +02:00
Vindaar 9a445c18bb fix `assertStringEqual` to make sure not to access null terminator 2018-10-12 16:00:39 +02:00
Vindaar f290876df7 replace `echo` + `quit(1)` by error call in `tquickstart.nim`
The call to `quit 1` failed on my machine. Hence use macros.error.
2018-10-12 16:00:39 +02:00
Vindaar fb13dc1627 further `isNil` checks in `tserialization` fixed 2018-10-12 16:00:39 +02:00
Vindaar 4821ef95fb [soft] take out yTagNimNilString/Seq and related (?) nil tests 2018-10-12 16:00:39 +02:00
Vindaar 7ad13d98d9 force vals in `quote do` to bool due to compile time when changes 2018-10-12 16:00:39 +02:00
Vindaar 011c99270f fix regression in times.parse syntax due to changes in times module
Probably due to the changes in the times module, the old syntax throws
an error now.
2018-10-12 16:00:39 +02:00
Vindaar 048f6615f5 fix for null terminator not accessable in strings anymore 2018-10-12 16:00:39 +02:00
Vindaar 890bbed5ed further `nil` fixes in `tojson` and `serialization` 2018-10-12 16:00:39 +02:00
Alexander Ivanov 566e28dcc5 Make it work with new not nil 2018-10-12 16:00:39 +02:00
flyx 6ca2a8e98a
README update
* project status
 * deleted transient fields from future feature list because it's implemented
2018-08-30 09:49:02 +02:00
Alexander Ivanov ba53fc0494 Load 0 fix #60 2018-08-30 09:21:30 +02:00
majj ddf22a3a41 experimental: notnil 2018-08-24 13:30:05 +02:00
majj 51d33d4a05 experimental: notnil 2018-08-24 13:30:05 +02:00
Marcus Eriksson 2328289dba Fixes #54 2018-05-29 19:12:03 +02:00
flyx e9658f22ec
Fixes #49 2017-11-14 15:52:11 +01:00