Commit Graph

153 Commits

Author SHA1 Message Date
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 16e72c6e1b Added README.md and private/events.nim 2015-12-29 18:38:22 +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
Felix Krause 6617033fd5 Better interface for loading to JSON 2015-12-29 12:33:41 +01:00
Felix Krause d828f4ddc5 Added benchmark. Fixed processing empty flow sets. 2015-12-29 00:14:47 +01:00
Felix Krause 7b6d9d18c5 Added copyright header to files in private/ 2015-12-28 22:24:05 +01:00
Felix Krause 7a5dd48188 Added copyright 2015-12-28 22:22:51 +01:00
Felix Krause 24f9cf167f Added doc generation task to config.nims 2015-12-28 22:13:14 +01:00
Felix Krause 238faf82ab Source restructuring, added config.nims
* moved src/* to .
 * added config.nims to build library and run tests
 * reduced compiler warnings
2015-12-28 22:03:16 +01:00
Felix Krause efe15f5754 Parse +-Inf and NaN into JSON 2015-12-28 19:25:53 +01:00
Felix Krause b1e828eae6 Added documentation comments 2015-12-27 23:40:27 +01:00
Felix Krause f2527efd46 Support additional boolean scalars
* on, off, yes, no, literals with leading or complete capital letters
 * added documentation
2015-12-27 21:36:47 +01:00
Felix Krause d67c772cd8 Properly handle newlines at end of file 2015-12-27 18:30:20 +01:00
Felix Krause 2c9d065ecb Support tags for sequences and maps in block style 2015-12-27 17:37:42 +01:00
Felix Krause d7f1e726ab Added dump() and transform()
* Added a hint "mapMayHaveKeyObjects" to yamlMap
 * Added dumper.nim
 * Improved generated documentation a bit
2015-12-27 16:36:32 +01:00
Felix Krause 075cf8b8ef Worked on tag URI interface
* Added YamlTagLibrary
 * adhere to explicit tags in JSON
 * Fixed lexer type hints before YAML flow special characters
2015-12-26 18:40:23 +01:00
Felix Krause ca0f5d1741 Refactoring, less heap objects
* YamlParserEvent -> YamlStreamEvent
 * YamlStreamEvent is no longer a `ref` object. Test suite now
   runs in a small fraction of a second (compared to several
   seconds before)
 * Introduced YamlStream
2015-12-26 13:39:43 +01:00
Felix Krause 2c4e681f0b Finished JSON parser. Restructuring.
* Made JSON parser resolve anchors and aliases
 * Moved exported consts and types to yaml.nim
2015-12-26 13:16:57 +01:00
Felix Krause c83d488886 Added JSON compositor. 2015-12-24 15:21:49 +01:00
Felix Krause b8afc8b9d9 Fixed bug with indentation parsing 2015-12-24 15:21:27 +01:00
Felix Krause e307cbbad5 Pipe type hints through parser. Fixed bugs. 2015-12-23 18:12:51 +01:00
Felix Krause ffcbbf89e6 Restructured source code 2015-12-23 12:35:07 +01:00
Felix Krause 5c0e9f570b Added type hinting in lexer 2015-12-23 10:28:58 +01:00
Felix Krause a9a1a67bc6 Support anchors on empty nodes 2015-12-22 23:35:03 +01:00
Felix Krause 545bff673a Support missing keys/values in maps 2015-12-22 22:28:27 +01:00
Felix Krause ca077e54ca Allow mixing explicit and implicit map keys 2015-12-22 21:08:58 +01:00
Felix Krause c1880b5117 Support tag handle after directives end 2015-12-22 18:51:16 +01:00
Felix Krause f249813b90 Implemented alias resolution
* Parse alias nodes properly
 * Fixed a bug that prevented you from having objects as map keys
 * Use AnchorId for reporting anchors instead of strings
 * Do not use nil strings for anchor and tag
2015-12-22 16:28:35 +01:00
Felix Krause e254d0f282 Made it work under Windows 2015-12-22 14:13:55 +01:00
Felix Krause f320449a2d Got tags working 2015-12-21 23:10:42 +01:00
Felix Krause 32f36515e7 Return TagIds instead of strings 2015-12-21 21:58:28 +01:00
Felix Krause 70597105cb Worked on tags
* introduced YamlSequentialParser object that stores
   all known tag URIs
 * Added procs for registering and querying tag URIs
 * Return non-specific tags instead of nil if no tags
   exist in source
2015-12-21 21:40:27 +01:00
Felix Krause edec7ece37 Implemented block scalars 2015-12-17 21:44:41 +01:00
Felix Krause 3ca3081e92 Added support for multiline plain scalars 2015-12-14 21:26:34 +01:00
Felix Krause b56f9cb537 Refactoring of parser. 2015-12-11 22:55:21 +01:00
Felix Krause 01416f61be Improved mixing block and flow content 2015-12-10 23:02:06 +01:00
Felix Krause ed7176131e Implemented flow style parsing
* Fixed lexer error where comma did not get properly processed
 * Implemented flow style in parser
 * Added tests
2015-12-10 22:28:57 +01:00
Felix Krause e642e41f90 Bug fixes in lexer and parser
* Lexer: column now always points to start of token
 * Lexer: added ability to compile with -d:yamlDebug for debug output
 * Parser: Correctly handle nested sequences and maps
 * Tests: Added parser tests for nested objects
2015-12-10 20:53:43 +01:00
Felix Krause 73ce41bbef Added parsing tests; got basic parsing working 2015-12-07 22:09:57 +01:00
Felix Krause ada4a36e6e Lexer: Fixed parsing verbatim tags 2015-12-07 19:09:02 +01:00
Felix Krause 0544a8bba0 Added sequential parser 2015-12-05 12:10:17 +01:00
Felix Krause 26c1c07567 No position in token; line and column in lexer 2015-11-30 20:36:55 +01:00
Felix Krause 9a3cf9a524 Renamed *LexerEvent* to *LexerToken* 2015-11-30 19:52:01 +01:00
Felix Krause 8493015042 Implemented anchors and aliases 2015-11-29 22:43:10 +01:00
Felix Krause f876c845b7 Own token kinds for every special char, more tests 2015-11-29 22:27:05 +01:00
Felix Krause 71456c6bed Fixed unicode escaping; added tests 2015-11-29 21:01:22 +01:00