Commit Graph

147 Commits

Author SHA1 Message Date
Felix Krause ad18db5113 Do not use first class iterators in serialization
* needed for JS backend
2016-09-01 20:56:34 +02:00
Felix Krause ef9159ab98 Removed trailing ws; JS fixes
* do not call writeStackTrace() if compiling to JS
2016-08-30 22:15:29 +02:00
Felix Krause 34cbe61479 Got rid of lots of compiler warnings 2016-08-17 22:50:37 +02:00
Felix Krause 30365d2f17 More refactoring
* Renamed ParserYamlStream to ParserContext
 * Moved almost all internal state from YamlParser to ParserContext
2016-08-17 22:21:34 +02:00
Felix Krause a9b82b0e45 Finished parser refactoring
* Re-implemented flow style handling
 * Deleted old parser code
2016-08-17 20:04:59 +02:00
Felix Krause 01b34290b7 Parser refactoring
* refactored parser to not use first class iterators
   (not available for JS backend)
 * Current state misses flow style handling and fails tests
2016-08-15 21:30:49 +02:00
Felix Krause 4ddc094cfd Internal changes to YamlStream (no API change)
* Prepared YamlStream for major parser refactoring
2016-08-10 20:42:44 +02:00
Felix Krause b6f730c459 Fixes #25 2016-08-09 21:20:25 +02:00
Felix Krause 09824f931b Refactoring of assertions, improved exceptions
* Replaced all assert statements with yAssert, which prints an error message
   and quits on failure, but does nothing when compiling with -d:release.
 * Implemented and used internalError for better discovery of internal bugs.
   Fixes #8.
 * Made RawYamlStream able to raise YamlStreamError, which might primarily be
   useful for user-defined serialization
 * Properly encapsulate RangeError coming from int/uint serialization on 64bit
   machines in YamlStreamError.
 * Some minor style improvements
2016-08-09 20:47:22 +02:00
Andrea Ferretti e33af48217 Fixed issue: integer numbers could not be parsed as float 2016-07-08 11:35:31 +02:00
Felix Krause 9054bf7630 Fixes #19 2016-07-07 17:46:23 +02:00
Andrea Ferretti 2d89cb7d36 Fixed type hints for floats 2016-07-07 17:14:18 +02:00
Felix Krause b01270dc9e Fixes #17 2016-06-26 12:41:06 +02:00
Felix Krause fb05fcc95f Fixed undeclared possible IndexError from queues 2016-06-26 12:37:15 +02:00
Felix Krause 280f0d6ce2 Check for multiple documents when dumping JSON 2016-06-08 20:07:29 +02:00
Felix Krause 5f6ed61e30 Fixed and improved canonical presentation 2016-06-08 20:01:46 +02:00
Felix Krause 9945375904 ... and now also fixed it for canonical form 2016-06-08 19:46:58 +02:00
Felix Krause 1df2444c50 Fixed a JSON presentation bug 2016-06-08 19:40:53 +02:00
Felix Krause 7cad7b5478 Fixed and properly implemented variant objects 2016-06-08 19:15:50 +02:00
Felix Krause 152a4f3bd3 NimYAML version 0.5.1
* Fixed a problem that was caused by a change in getType in Nim devel
2016-06-05 20:52:43 +02:00
Felix Krause 48aeff20c0 Use variant object types for heterogeneous data
* Made variant object types work (really this time)
 * Added `markAsImplicit`
 * Implemented implicit variant object types
 * Added documentation
2016-06-05 19:29:16 +02:00
Felix Krause e81da97a17 Removed most of variant-object specific code
* fieldPairs() already handles variant objects fine. decided not to
   go further along the way of identifying object variants by their
   discriminants in tag URIs.
 * variant objects are now supported just like normal objects.
2016-06-05 15:43:39 +02:00
Felix Krause a0c435d6eb Finally got variant objects to work
* may still require some polish before merging
2016-05-25 23:32:49 +02:00
Felix Krause 592158fad0 Merge branch 'master' into variant-objects 2016-05-25 23:18:32 +02:00
Felix Krause f5431af0fd fastparse refactoring, part III
* Changed some more templates to procs
2016-05-23 21:10:28 +02:00
Felix Krause 78fac63af5 fastparse refactoring, part II
* Transformed quite some templates to procs
 * Moved quite some local vars from parse() to YamlParser
2016-05-21 23:26:39 +02:00
Felix Krause 10fec5fb1f fastparse refactoring, part I
* Replaced lots of templates with procs
 * Some minor improvements
2016-05-21 22:08:19 +02:00
Felix Krause f73dfdc6ab Worked on variant objects (not working) 2016-05-09 19:03:11 +02:00
Felix Krause 4ca4b2c87e Support nil strings and seqs 2016-04-04 21:21:24 +02:00
Felix Krause 58b9b92895 Support int, uint and float types. 2016-04-04 20:44:16 +02:00
Felix Krause 6ad7e33bb5 Reduced dead code and compiler warnings 2016-04-03 11:45:48 +02:00
Felix Krause f2c83cc170 Support array types. Updated documentation 2016-04-03 11:29:49 +02:00
Felix Krause a267f73e0a Serialization: support sets 2016-04-02 18:29:26 +02:00
Felix Krause cde346b85c Switched to indentation of 2 spaces 2016-04-02 17:48:22 +02:00
Felix Krause 7063e72ace Added advanced example to index.html 2016-03-25 23:12:00 +01:00
Felix Krause 5ec086081c Implemented serialization of OrderedMap 2016-03-25 22:22:42 +01:00
Felix Krause 06faf4966d Object fields get the tag !nim:field. Fixes #12. 2016-03-25 21:38:28 +01:00
Felix Krause 42ddfbe5c5 Fixes #13.
* Separated into representObject and in representChild and
   representObject. Makes it possible for multiple types to
   use the same representObject proc.
2016-03-25 21:27:41 +01:00
Felix Krause c18fd47511 Some litte performance increases 2016-03-25 18:22:25 +01:00
Felix Krause 28ccdcc5a6 Handle block scalars line-per-line. Fixes #10 2016-03-25 18:17:37 +01:00
Felix Krause 93ce0b26ba Some performance optimization with shallowCopy 2016-03-25 10:13:55 +01:00
Felix Krause 57b4518564 Fixed presenter bug
* Fixed TagIds for Nim's system types
 * Output JSON integers for Nim's integer types
 * Output JSON floats for Nim's float types
2016-03-20 19:55:23 +01:00
Felix Krause a9b565c35c Eliminated dead code, fixed serialization
* fpBlockContinueScalar wasn't used anymore and has been removed
 * Do not mark scalarContent in events as shallow because it breaks
   peeking in YamlStreams
2016-03-20 14:19:46 +01:00
Felix Krause a1f914eee4 Got rid of fpBlockLineStart, fixes #9 2016-03-20 13:50:00 +01:00
Felix Krause b6d363107a Performance optimizations in parser 2016-03-20 12:09:04 +01:00
Felix Krause eef247b2e8 Fixed parser bug, added option to output YAML 1.1
* Fixed a parser bug that got confused when looking for an implicit
   map key in a plain scalar that contains &, * or !
 * Added OutputYamlVersion to PresentationOptions
2016-03-20 10:31:40 +01:00
Felix Krause 5688499650 Fixed bugs with presenting block scalars
* Folded block scalars were presented with "|" instead of ">"
 * It has not been properly detected that a scalar cannot be outputted as
   literal block scalar
2016-03-20 09:21:52 +01:00
Felix Krause 4d4e3c94e1 Added fplDocument, fixes #11
* Do not use -1 for unknown indentation, because the document level is -1.
 * Use const UnknownIndentation in code instead of magic number
 * Added fplDocument level which is used as root of the ancestry
 * Added debugFail() template to better locate internal errors
2016-03-19 22:45:24 +01:00
Felix Krause e45eb7b514 Fixed some bugs
* Ensure that no event is yielded twice at explicit document end
 * Properly handle indentation when comment occurs in a line before the
   start of the node
 * Allow multiline implicit map keys in flow map
2016-03-19 15:54:19 +01:00
Felix Krause 0fc30241b9 Fixes for block scalars and doc end markers
* Properly (now really) handle block scalars at doc root
 * Properly handle multiple document end markers
2016-03-19 15:03:09 +01:00