/ CHANGELOG.md
CHANGELOG.md
1 ## 2.1.1 2 3 Bugfixes: 4 5 * Fixed a bug that prevented float values to be serialized (#141) 6 7 ## 2.1.0 8 9 Features: 10 11 * New pragmas ``scalar`` and ``collection`` allow you to modify the 12 presentation style used for certain types and object fields. 13 Defined in new module ``yaml/style``. 14 * The presenter now honors the node style set in the events it presents, 15 if possible. So if a scalar is set to be a literal block scalar, it is 16 presented as such unless impossible or presenter options specifically 17 prevent this. 18 * The presenter can now output single-quoted scalars. It only does so when 19 this scalar style is explicitly set on an event. 20 21 Changes: 22 23 * renamed ``canonicalDumper`` / ``setCanonicalStyle`` to 24 ``explanatoryDumper`` / ``setExplanatoryStyle`` because it was 25 a misnomer and there is nothing canonical about this output style. 26 The terminology *canonical* was carried over from PyYAML, but the 27 YAML specification uses that term for different things. 28 The old names are kept with a ``deprecated`` pragma. 29 * The ``explanatoryDumper`` now automatically enables the 30 tag shorthand ``!n!``, because in this style you want that for readability. 31 32 Bugfixes: 33 34 * Fixed a bug that prevented instances of generic types to be used in ``Option`` 35 fields (e.g. ``Option[seq[string]]``) (#101) 36 * Fixed a bug that caused invalid indentation when dumping with certain 37 settings (#140) 38 * Fixed parsing errors for verbatim tags in flow style (#140) 39 * Fixed a bug that caused presentation of block scalars in 40 flow collections (#140) 41 * Fixed a bug that sometimes caused the last word of a folded block scalar 42 not to be presented. 43 * Fixed maximum line length not properly implemented in presenter in a number 44 of cases. 45 * Fixed a bug that prevented the presenter from outputting compact 46 flow mappings in cMixed mode. 47 * Fixed block scalars as mapping keys not being presented properly. 48 * Added workaround for a regression bug in Nim 2.0.2 49 (https://github.com/nim-lang/Nim/issues/23112) 50 51 ## 2.0.0 52 53 Breaking Changes: 54 55 * Requires Nim 2.x 56 * ``yaml/serialization`` has been split into 57 ``yaml/native`` (low-level API to load a ``YamlStream`` into Nim vars), 58 ``yaml/loading`` (high-level loading API) and 59 ``yaml/dumping`` (high-level dumping API). 60 * Dumping API now has a ``Dumper`` object. 61 All dumping procs require an instance of this object. 62 Previous parameters ``tagStyle``, ``handles`` and ``options`` have been 63 moved into this object. 64 * Constants with default values have been removed in favor of default values 65 for object fields. 66 * Low-level native API for loading and dumping has undergone changes to 67 parameter order. Serialization and deserialization context is now first 68 parameter, to be able to use prefix notation. 69 * Removed ``PresentationStyle``; instead ``Dumper`` can be initialized with 70 presets mirroring the former values of ``PresentationStyle``. 71 * Removed deprecated ``YamlDocument`` type from DOM API. 72 Use ``YamlNode`` instead. 73 74 Features: 75 76 * Can now load and dump fields of the parent type(s) of used types (#131) 77 * Updated type guessing to use regexes from YAML 1.2 instead of old YAML 1.1. 78 Type guessing is used primarily for heterogeneous items 79 (implicit variant objects). 80 * Presenter no longer outputs trailing spaces 81 * More presentation options 82 * Simplified default presentation style: Don't output ``%YAML 1.2``, 83 ``%TAG !n! ...`` or ``---`` by default. 84 Output compact notation for collections. 85 * Loading now works at compile time (#70, #91). 86 Dumping doesn't work at compile time currently. 87 88 Bugfixes: 89 90 * Don't crash on invalid input, instead raise a catchable 91 ``YamlParserError`` (#129) 92 * Fixed some parser errors in exotic edge cases 93 * Several fixes to make the library work with Nim 2.x 94 95 ## 1.1.0 96 97 Features: 98 99 * ``YamlNode`` now contains node styles and preserves them 100 when serializing to YAML again 101 * Added ``maxLineLength`` to ``PresentationOptions``. (#119) 102 * Added ``loadFlattened`` to resolve aliases while loading, 103 instead of deserializing them into pointers. (#117) 104 105 Bugfixes: 106 107 * Fixed problems with ARC/ORC (#120) 108 * Fixes some edge cases around whitespace while parsing 109 * Fixed a problem that made ``{.ignore: [].}`` fail when trying 110 to ignore collection values. (#127) 111 * Always write a newline character at the end of output, as required 112 by POSIX for text files. 113 * Fixed an error with loading recursive nodes into YamlNodes. 114 * Fixed an error where ``0`` could not be loaded into an unsigned 115 integer lvalue. (#123) 116 * Fixed an error where `float32` values could not properly 117 be deserialized. (#124) 118 * Fixed a compiler error concerning stricteffects. (#125) 119 120 ## 1.0.0 121 122 Features: 123 124 * ``YamlNode`` can now be used with the serialization API (``load`` / ``dump``) 125 and can be used to hold substructures that should not be deserialized to 126 native types (#48). 127 128 Bugfixes: 129 130 * Raise a proper exception when a stream contains no documents but one is 131 expected (#108) 132 * Comments after a block scalar do not lead to a crash anymore (#106) 133 * Fixed an error with parsing document end markers (#115) 134 * Fixed an error when serializing block scalars (#105) 135 136 ## 0.16.0 137 138 Features: 139 140 * dumping ``sparse`` objects now omits empty ``Option`` fields (#100). 141 142 Bugfixes: 143 144 * Fixed several parser errors that emerged from updates on the test suite. 145 * Fixed ``raises`` annotations which could lead to compilation errors (#99). 146 147 ## 0.15.0 148 149 Features: 150 151 * Compiles with --gc:arc and --gc:orc 152 153 Bugfixes: 154 155 * Parser rewrite: Fixes some test suite errors (including #83) 156 * Fixed problems where a syntax error lead to an invalid state (#39, #90) 157 * Serialize boolean values as ``true`` / ``false`` instead of ``y`` / ``y`` 158 to conform to YAML 1.2 spec. 159 160 ## 0.14.0 161 162 Features: 163 164 * **Breaking change**: 165 transient, defaultVal, ignore and implicit are now annotations. 166 * Added ``sparse`` annotation to treat all ``Option`` fields as optional. 167 168 Bugfixes: 169 170 * can now use default values with ref objects (#66) 171 172 ## 0.13.1 173 174 Bugfixes: 175 176 * Changed `nim tests` to `nim test` to make nim ci happy. 177 178 ## 0.13.0 179 180 Bugfixes: 181 182 * Fixed submodule link to yaml-test-suite. 183 184 Features: 185 186 * Added support for `Option` type. 187 188 ## 0.12.0 189 190 Bugfixes: 191 192 * Made it work with Nim 0.20.2 193 194 ### 0.11.0 195 196 Bugfixes: 197 198 * Made it work with Nim 0.19.0 199 200 NimYAML 0.11.0 is unlikely to work with older Nim versions. 201 202 ## 0.10.4 203 204 Bugfixes: 205 206 * Made it work with Nim 0.18.0 207 208 ### 0.10.3 209 210 Bugfixes: 211 212 * Fixed a nimble error when installing the package. 213 214 Features: 215 216 * Added `ignoreUnknownKeys` macro to ignore all mapping keys that do not map 217 to a field of an object / tuple (#43). 218 219 ### 0.10.2 220 221 Bugfixes: 222 223 * Fixed a nimble warning (#42) 224 * Make sure special strings (e.g. "null") are properly quoted when dumping JSON 225 (#44) 226 227 ### 0.10.1 228 229 Bugfixes: 230 231 * Made it *actually* work with Nim 0.17.0. 232 233 ### 0.10.0 234 235 Features: 236 237 * Compatibility with Nim 0.17.0 (#40). 238 **Important:** This fix breaks compatibility with previous 239 Nim versions! 240 241 ### 0.9.1 242 243 Features: 244 245 * Added `YamlParser.display()` which is mainly used by tests 246 * NimYAML now builds for JS target (but does not work properly yet) 247 248 Bugfixes: 249 250 * Correctly present empty collections in block-only style (#33) 251 * Correctly handle `{1}` (#34) 252 * Recognize empty plain scalar as possible `!!null` value 253 * Require colons before subsequent keys in a flow mapping (#35) 254 * Allow stream end after block scalar indicators 255 * Fixed regression bugs introduced with timestamp parsing (#37) 256 257 ### 0.9.0 258 259 Features: 260 261 * Better DOM API: 262 - yMapping is now a Table 263 - field names have changed to imitate those of Nim's json API 264 - Better getter and setter procs 265 * Added ability to resolve non-specific tags in presenter.transform 266 267 Bugfixes: 268 269 * Fixed parsing floating point literals (#30) 270 * Fixed a bug with variant records (#31) 271 * Empty documents now always contain an empty scalar 272 * Block scalars with indentation indicator now have correct whitespace on first 273 line. 274 275 ### 0.8.0 276 277 Features: 278 279 * NimYAML now has a global tag URI prefix for Nim types, 280 `tag:nimyaml.org,2016:`. This prefix is denoted by the custom tag handle 281 `!n!`. 282 * Support arbitrary tag handles. 283 * Added ability to mark object and tuple fields as transient. 284 * Added ability to set a default value for object fields. 285 * Added ability to ignore key-value pairs in the input when loading object 286 values. 287 * Support `!!timestamp` by parsing it to `Time` from module `times`. 288 289 Bugfixes: 290 291 * Fixed a bug concerning duplicate TagIds for different tags in the 292 `serializationTagLibrary` 293 * Convert commas in tag URIs to semicolons when using a tag URI as generic 294 parameter to another one, because commas after the tag handle are interpreted 295 as flow separators. 296 297 ### 0.7.0 298 299 Features: 300 301 * Better handling of internal error messages 302 * Refactoring of low-level API: 303 * No more usage of first-class iterators (not supported for JS target) 304 * Added ability to directly use strings as input without stdlib's streams 305 (which are not available for JS) 306 * Added ability to parse octal and hexadecimal numbers 307 * Restructuring of API: now available as submodules of yaml. For backwards 308 compatibility, it is still possible to `import yaml`, which will import all 309 submodules 310 * Check for missing, duplicate and unknown fields when deserializing tuples and 311 objects 312 313 Bugfixes: 314 315 * Fixed double quotes inside plain scalar (#25) 316 * Return correct line content for errors if possible (#23) 317 * Some smaller lexer/parser fixes 318 319 ### 0.6.3 320 321 Bugfixes: 322 323 * Can load floats from integer literals (without decimal point) (#22) 324 325 ### 0.6.2 326 327 Bugfixes: 328 329 * Fixed problem when serializing a type that overloads the `==` operator (#19) 330 * Fixed type hints for floats (`0` digit was not processed properly) (#21) 331 332 ### 0.6.1 333 334 Bugfixes: 335 336 * Fixed deserialization of floats (#17) 337 * Handle IndexError from queues properly 338 339 ### 0.6.0 340 341 Features: 342 343 * Properly support variant object types 344 * First version that works with a released Nim version (0.14.0) 345 346 Bugfixes: 347 348 * Fixed a crash in presenter when outputting JSON or canonical YAML 349 * Raise an exception when trying to output multiple documents in JSON style 350 351 ### 0.5.1 352 353 Bugfixes: 354 355 * Fixed a problem that was introduced by a change in Nim devel 356 357 ### 0.5.0 358 359 Features: 360 361 * Support variant object types (experimental) 362 * Added ability to use variant object types to process 363 heterogeneous data 364 * Support `set` type 365 * Support `array` type 366 * Support `int`, `uint` and `float` types 367 (previously, the precision must be specified) 368 * Check for duplicate tag URIs at compile time 369 * Renamed `setTagUriForType` to `setTagUri` 370 371 Bugfixes: 372 373 * None, but fastparse.nim has seen heavy refactoring 374 375 ### 0.4.0 376 377 Features: 378 379 * Added option to output YAML 1.1 380 * Added benchmark for processing YAML input 381 * Serialization for OrderedMap 382 * Use !nim:field for object field names (#12) 383 384 Bugfixes: 385 386 * Code refactoring (#9, #10, #11, #13) 387 * Some small improvements parsing and presenting 388 389 ### 0.3.0 390 391 Features: 392 393 * Renamed some symbols to improve consistency (#6): 394 - `yamlStartSequence` -> `yamlStartSeq` 395 - `yamlEndSequence` -> `yamlEndSeq` 396 - `yamlStartDocument` -> `yamlStartDoc` 397 - `yamlEndDocument` -> `yamlEndDoc` 398 - `yTagMap` -> `yTagMapping` 399 * Introduced `PresentationOptions`: 400 - Let user specify newline style 401 - Merged old presentation options `indentationStep` and `presentationStyle` 402 into it 403 * Use YAML test suite from `yaml-dev-kit` to test parser. 404 405 Bugfixes: 406 407 * Fixed various parser bugs discovered with YAML test suite: 408 - Block scalar as root node no longer leads to a parser error 409 - Fixed a bug that caused incorrect handling of comments after plain scalars 410 - Fixed bugs with newline handling of block scalars 411 - Fixed a bug related to block sequence indentation 412 - Skip content in tag and anchor names and single-quoted scalars when 413 scanning for possible implicit map key 414 - Properly handle more indented lines in folded block scalars 415 - Fixed a problem with handling ':' after whitespace 416 - Fixed indentation handling after block scalar 417 418 ### 0.2.0 419 420 Features: 421 422 * Added DOM API 423 * Output block scalars in presenter if scalar is long and block scalar output 424 is feasible. Else, use multiple lines for long scalars in double quotes. 425 426 Bugfixes: 427 428 * Improved parser (#1, #3, #5) 429 * Made parser correctly handle block sequences that have the same indentation 430 as their parent node (#2) 431 * Fixed problems with outputting double quoted strings (#4) 432 433 ### 0.1.0 434 435 * Initial release