Commit Graph

64 Commits

Author SHA1 Message Date
Felix Krause 6edee9c81b Merge branch 'master' of ../../git/NimYAML 2016-01-07 11:32:09 +01:00
Felix Krause 9d708aa203 Enhanced server errror reporting 2016-01-07 11:31:45 +01:00
Felix Krause 4243226738 Support alias on more positions 2016-01-07 11:29:37 +01:00
Felix Krause 433ec3f114 Fixed server. 2016-01-05 23:19:00 +01:00
Felix Krause ca0a30900c Fixed CORS header 2016-01-05 21:36: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 8b12d069a5 More TODOs 2016-01-05 17:00:49 +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 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