Commit Graph

164 Commits

Author SHA1 Message Date
Felix Krause 4243226738 Support alias on more positions 2016-01-07 11:29:37 +01:00
Felix Krause 68f0ba0cc7 Added jester-based YAML parsing webservice
* Added server/server.nim
 * Fixed a problem in presenter that made it crash when
   outputting a root map to JSON
2016-01-05 21:34:07 +01:00
Felix Krause f3f6f5de9e Added explicit raises pragma to present()
* Added YamlPresenter*Error exceptions
 * Added raises pragma to present()
 * catch exceptions from YamlStream and Stream in present() and
   put them as cause into YamlPresenter*Error
 * Added loadToJson() proc
 * Give "~" the type hint yTypeNull
 * Always output "null" for yTagNull/yTypeNull scalars when
   presenter is in JSON mode
2016-01-05 19:58:46 +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 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 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 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