Commit Graph

197 Commits

Author SHA1 Message Date
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
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
Jacob MacDonald 4933194dd6 Fix for newer versions of compiler.
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).
2017-10-03 15:59:45 +02:00
Felix Krause 8d8464da71 Fixes #43 2017-09-20 18:58:09 +02:00
Felix Krause 37031c4c80 make tests green again 2017-08-30 18:11:18 +02:00
Felix Krause ff86083461 Fixes #44 2017-08-30 18:04:52 +02:00
Felix Krause 0caebe2618 Revert "Actual fix for #40" because it's shit
This reverts commit 15f8995ae2.
2017-07-10 19:52:34 +02:00
Felix Krause 15f8995ae2 Actual fix for #40 2017-06-30 16:45:32 +02:00
Zahary Karadjov 7a122adad3 fix #40 2017-06-30 16:07:43 +03:00
Felix Krause f07cf173dc Fixed to previous JS adjustments 2017-03-30 17:58:53 +02:00
Felix Krause 7ba95845e0 JS improvements; also added constructObjectDefault 2017-03-29 21:42:07 +02:00
Felix Krause 71b075abf6 Allow backticked field names in macros 2017-03-29 18:38:31 +02:00
Felix Krause a48bf086b7 Merge branch 'devel' of github.com:flyx/NimYAML into devel 2017-03-29 17:15:04 +02:00
Felix Krause f017a57d86 Made NimYAML compile for JS 2017-03-29 17:14:50 +02:00
flyx fc9ed39efd Make `0` a valid integer 2017-03-29 16:39:51 +02:00
flyx 75548f956b Fixes #37 2017-03-29 15:40:13 +02:00
Felix Krause 83efb88978 Fixed compilation error 2017-02-18 12:31:23 +01:00
Felix Krause e30739fb36 final final fixes for event rendering 2017-02-18 10:40:39 +01:00
Felix Krause d6ace28775 (hopefully) final event output fix 2017-02-14 22:30:48 +01:00
Felix Krause b15f3dbae9 Even more fixes to event output 2017-02-14 22:22:56 +01:00
Felix Krause 8abe91cb32 Further event output improvements 2017-02-14 22:08:38 +01:00
Felix Krause 2bb32139c4 Added `+DOC ---` event output. Fixed parserTests 2017-02-14 22:06:48 +01:00
Felix Krause 9eee22bbc5 Improved event output conformity 2017-02-14 21:53:15 +01:00
Felix Krause 8b4f781d41 Added anchor name to display() 2017-02-14 19:43:02 +01:00
Felix Krause c581f1acc2 Added YamlParser.display()
* renders events with proper tag and anchor names
2017-02-14 19:40:40 +01:00
Felix Krause 58ef5da17b Made token output conform to yaml test suite
* Added -d:yamlScalarRepInd switch
 * Modified `$` on stream items to use yaml test suite format
2017-02-14 19:06:41 +01:00
Felix Krause 5ebde01ca5 Made tjson and tserialization compile for JS 2017-02-13 17:10:56 +01:00
Felix Krause 0ef9cbf535 Moved private sources to yaml/private 2017-02-06 20:39:04 +01:00
Felix Krause d8f6ea5e2d Fixed an error in flow map parsing
* { ? foo: bar } emitted an additional, second, empty
   key-value pair
2017-02-06 20:35:17 +01:00
Felix Krause e46ef33a23 Allow stream end after block scalar indicators 2017-01-13 16:25:46 +01:00
Felix Krause b99fa8df7a Fixes #35 2017-01-13 16:19:04 +01:00
Felix Krause 538a2d2deb Recognize empty string as !!null 2017-01-12 11:19:46 +01:00
Felix Krause f78c2c5961 Correctly handle `{1}`. Fixes #34 2017-01-10 12:00:15 +01:00
Felix Krause 936df70daa Correctly present empty collections in block-only.
* Fixes #33
2017-01-10 11:45:55 +01:00
Felix Krause 356dc5c8bd Added testSuiteEvents tool 2017-01-09 19:09:07 +01:00
Felix Krause 87bfcd1490 Fixed bugs
* lexer did not handle indentation indicator for block scalars properly
 * transform() did not work properly for string output
2016-12-13 21:22:36 +01:00
Felix Krause 4b529c1fd6 Fixed and improved presenter.transform
* Added option to resolve non-specific tags
 * Actually resolve non-specific tags
 * Made it compile again after hints enhancement
2016-12-05 18:27:32 +01:00
Felix Krause 44ca31b1e2 Empty documents always contain an empty scalar 2016-11-30 21:58:46 +01:00
Felix Krause 40e303049f Documented serialization macros 2016-11-30 18:31:09 +01:00
Felix Krause 5e00d714eb Do not assume RecLists everywhere. Fixes #31 2016-11-30 18:01:03 +01:00
Felix Krause 84d4127caf Improved DOM API
* yMapping is now a Table
 * changed names to match those of the json module
 * implemented procs to easier get and set values
2016-11-28 20:17:04 +01:00
Felix Krause a51befe30d Improved float parsing
* Fixed #30
 * Accept underscores in float literals
 * Added test
2016-11-10 10:12:32 +01:00
Felix Krause 64f68ae1af Implemented !!timestamp 2016-11-08 21:13:01 +01:00
Felix Krause dcfa8fd27c Implemented ignoreInputKey 2016-10-27 17:58:14 +02:00
Felix Krause 6402433d2a Implemented setDefaultValue. 2016-10-26 18:32:54 +02:00
Felix Krause 9290ca0d91 Load objects with transient fields 2016-10-19 22:04:46 +02:00
Felix Krause ab8bfe4192 Removed garbage code 2016-10-15 18:30:52 +02:00
Felix Krause 3ab3dc7ad0 Dump variant objects with transient fields
* tuples not working yet
 * loading not woring yet
 * added tests
2016-10-15 17:58:29 +02:00
Felix Krause b3d83025f7 Started transient implementation
* represent of simple object works
 * TODO: variant objects
 * TODO: construct
2016-10-12 22:39:59 +02:00
Felix Krause 29352fa4fe Use global tag handle for NimYAML
* NimYAML now uses the tag prefix tag:nimyaml.org,2016:
 * That tag handle is shortened to !n! when presenting
 * Also fixed some minor bugs dealing with tag handles
2016-10-10 20:16:54 +02:00
Felix Krause 4bde3a7986 Fixed issues in quickstart and taglib
* Updated expected YAML in 02
 * Fixed duplicate TagIds in taglib
2016-10-09 11:48:52 +02:00
Felix Krause 0f2e077b87 Added automatic test for quickstart snippets
* There are errors which indicate real bugs!
2016-10-08 23:35:33 +02:00
Felix Krause 9f7e87e935 Ordered snippets with file system hierarchy 2016-10-08 20:57:53 +02:00
Felix Krause b9f569a3cf Fixed a GC problem; improved bench & tojson 2016-09-30 19:35:43 +02:00
Felix Krause 3942e80d9b Improved error messages and test them. 2016-09-24 16:45:49 +02:00
Felix Krause 2ad41d349e Improved and fixed issues with error reporting 2016-09-23 15:42:24 +02:00
Felix Krause a8d68d1696 Addressed some compiler warnings 2016-09-22 14:25:10 +02:00
Felix Krause 680e419d12 Simplified field checking 2016-09-22 14:16:10 +02:00
Felix Krause 1dc8ddc6ea got rid of yaml.common 2016-09-22 13:28:24 +02:00
Felix Krause 5dfc984913 Updated documentation for new structure 2016-09-21 21:20:57 +02:00
Felix Krause d987b607e5 Check for custom object errors when loading
* Ensure no duplicate fields
 * Ensure no missing fields
 * Ensure no unknown fields
 * Implemented for both tuples and objects,
   including variant objects
2016-09-21 15:40:03 +02:00
Felix Krause 6bb110b185 Made bench great again 2016-09-21 10:44:40 +02:00
Felix Krause 12960b2e31 Restructuring: no more includes 2016-09-20 21:53:38 +02:00
Felix Krause 325e3ec18f Made serialization part of yaml. Improved doc. 2016-02-12 20:44:38 +01:00
Felix Krause c6c13eb044 Better doc index. YamlStream now an object.
* Also various fixes to serialization and presentation
2016-02-12 19:53:25 +01:00
Felix Krause 32c42054f7 Renamed serialize() to represent() to better conform to YAML spec 2016-02-02 18:19:40 +01:00
Felix Krause e89a9a5b14 Serialization: Support enum types 2016-02-01 20:16:35 +01:00
Felix Krause e967038d06 Support custom types without serialize macro 2016-02-01 19:48:42 +01:00
Felix Krause f74a5da999 Implemented construction of ref objects. 2016-01-28 22:29:26 +01:00
Felix Krause 96f01385ef Implemented serializing ref objects. 2016-01-28 21:59:26 +01:00
Felix Krause 5162c310ce Serialization: Better proc names
* renamed serialize to serializeObject and construct to constructObject
 * added new serialize() and construct() procs that handle document
   start & end
 * re-raise AssertionError instead of swallowing it
2016-01-26 20:51:21 +01:00
Felix Krause 4c3f7cd485 Better and more system types for serialization
* Use int[8|16|32|64] and float[32|64] instead of int and float
 * Support uint[8|16|32|64]
 * Support char
2016-01-26 20:00:28 +01:00
Felix Krause 24f44b5022 Fixed wrapped exception handling 2016-01-24 21:38:29 +01:00
Felix Krause f2c81f1fc5 Small improvements 2016-01-24 21:21:37 +01:00
Felix Krause 36872370d5 Fixed bugs in presenter, serialization, README
* Made presenter output numbers without double quotes in
   JSON style again
 * Fixed broken serialization.load
 * Updated examples in README
2016-01-24 20:53:51 +01:00
Felix Krause 8436026250 Sanitized exception handling in serialization 2016-01-24 20:38:30 +01:00
Felix Krause fdcc699768 Removed old lexer/parser impl in favor of new one
* fastparse now used for everything
 * private/[lexer|parser].nim gone
 * Made fastparse use YamlParser object
 * Got all tests working with fastparse
 * Some more smaller changes to API
2016-01-24 11:44:10 +01:00
Felix Krause 56d3537920 Refactoring: Shorter type names 2016-01-14 22:51:30 +01:00
Felix Krause 551c8b0dd1 Refactoring: Extracted type guessing from lexer 2016-01-14 19:58:38 +01:00
Felix Krause 18753b1a4a Got rid of yamlWarning, use YamlPresenterError
* Added YamlWarningCallback that may be used to capture
   parser warnings
 * Removed yamlWarning as event kind
 * Replaced checks for well-formedness in presenter with asserts
 * Added checks for JSON compatibility of YamlStream in presenter
 * Added proper type hints for special float values in
   serializer to be able to check for them in the presenter
2016-01-05 19:06:55 +01:00
Felix Krause d2baa1749e Got rid of yamlError.
* Replaced yielding yamlError tokens with raising a YamlParserError
 * Renamed sequential.nim to parser.nim because it's the parser (duh)
2016-01-05 18:14:11 +01:00
Felix Krause d64184c025 Support serializing tuples. Multiple bugfixes.
* Parser: Properly support explicit keys in flow style.
 * Parser: Properly support object tags in flow style.
 * Serializer: Basic support for tuples.
 * Serializer: Properly parse int and bool types when given as
   string with explicit tag.
2016-01-05 16:54:14 +01:00
Felix Krause aa98c5863e Properly handle ytsRootOnly
* Yield tag of custom type serialization when using ytsRootOnly,
   but don't yield tags of map keys or values
 * Yield proper tag of Table[K, V] serialization if requested
 * renamed dumper.nim to presenter.nim to conform to YAML spec
2016-01-04 22:18:55 +01:00
Felix Krause 507c621aaf Implemented local tags for serialization
* Fixed a bug in the lexer where an error would be raised if
   characters not allowed in tag shorthands are used in local tags
 * Fixed processing of object tags for all kinds of root nodes in Parser
 * Improved dumper to output a space after a local tag
 * Renamed some enumeration types to conform better to the YAML spec
 * Added secondaryPrefix to YamlTagLibrary
 * Added possibility to control tag output style independently from
   presentation style in serializer
 * Created local tags for all types that are serialized and use them in
   construction and serialization
2016-01-04 21:46:33 +01:00
Felix Krause 57bf7cd12c Removed binary file, added TODO items 2015-12-29 18:54:24 +01:00
Felix Krause a094089fb9 Various improvements
* Better JSON serialization (map bool literals to true/false if
   possible)
 * Fixed a problem where the tag of block sequence would be
   wrongly placed
 * Always output "" when dumping empty strings
 * Added helper functions to create YamlStreamEvents.
 * Moved procs for YamlStreamEvents to private/events.nim
 * renamed dump() to present()
 * Added dump() and load() to yaml.serialization
2015-12-29 18:22:55 +01:00
Felix Krause 9ff93efb11 Implemented basic serialization
* added serialize() procs for some basic types
 * extended make_serializable to generate serialize() proc
2015-12-29 16:10:47 +01:00
Felix Krause dc1a3c0fe2 Can construct basic types and custom objects
* Added construct() procs for some basic types
 * Added macro make_serializable
2015-12-29 15:09:37 +01:00