Commit Graph

555 Commits

Author SHA1 Message Date
kdeme 7721c955b5 Export yaml specific exceptions that are part of API 2024-07-17 18:04:36 +02:00
Felix Krause 25f600ebcd
Fixed link to website in Readme
* fixes #143
2024-06-26 11:04:34 +02:00
Felix Krause cac1a3bd7c presenter: implicit check for dBlockInlineMap
* fixes #142
2024-03-05 18:37:55 +01:00
Felix Krause 48a90e36e8 fixes #141. Version 2.1.1 2024-01-18 08:08:41 +01:00
Felix Krause eee45683ea Simplified docs, fixed some links. v2.1.0 2023-12-30 16:37:02 +01:00
Felix Krause cdbf426f6b Workaround for Nim regression #23112 2023-12-30 16:06:41 +01:00
Felix Krause c7e5a8aec9 fix previous commit 2023-12-09 10:20:40 +01:00
Felix Krause 4e84186f93 Better error reporting for implicit pragma 2023-12-09 10:13:14 +01:00
Felix Krause da5d37e437 Removed obsolete entries in config.nims 2023-12-09 09:51:17 +01:00
Felix Krause c509953289 Documentation overhaul.
* submodule docs are now located at /api/yaml/<name>.html instead of
   /api/<name>.html.
 * can now simply link to symbols in other modules.
 * fixed some links
 * fixed quickstart example list
 * added quickstart item displaying the new style api
 * fixed a bug in presenter that doubled a line in literal/flow style
2023-11-27 23:05:05 +01:00
Felix Krause bf87d508d0 Fixed presenter regarding new style annotations
* fixed presentation of flow mappings inside block collections
 * improved logic checking whether a collection can be written on a
   single line
 * fixed tests
2023-11-14 15:30:43 +01:00
Felix Krause a698289223 New pragmas for customizing presentation
* added yaml/style that defines representation pragmas
   `scalar` and `collection`
 * implemented those pragmas
 * updated docs. also fixes some invalid links in docs
2023-11-11 15:36:10 +01:00
Felix Krause 03c95da97c Presenter improvements and new features
* Presenter now tries to write style given in event
 * Can write single quoted
 * several fixes to line length handling
 * sever other presenter fixes
 * updated server deps
 * updated server code to use new presenter features
   (or rather, not use, as the server *should* alter the
   input style instead of outputting it as-is)
2023-11-11 13:20:56 +01:00
Felix Krause a2f289a8bc Improved documentation.
* also renamed canonicalDumper to explanatoryDumper
   because there's nothing canonical about it
2023-11-10 21:24:04 +01:00
Felix Krause fc9641aee9 CI: run all tests even if one fails 2023-11-07 22:54:43 +01:00
Felix Krause 3d98b5ea22 don't present block scalars in flow collections
* ensure no block scalars (literal, folded) are output inside of flow
   collections
 * ref #140
2023-11-07 22:48:42 +01:00
Felix Krause 00387d955f Fixed parsing verbatim tags
* verbatim tags containing '[', ']' or ',' were not properly parsed in
   flow style collections
 * ref #140
2023-11-07 22:11:40 +01:00
Felix Krause bf65a97cbe Fixed indentation problems when dumping
* certain configurations of the Dumper added twice the requested
   indentation.
 * ref #140
2023-11-07 21:55:13 +01:00
Felix Krause 854d33378e fixes #101, minor improvements
* improved error reporting on wrong tags
 * removed a debug `echo` call
 * fixed problems with sparse objects and Option (#101)
2023-11-05 15:10:29 +01:00
Felix Krause 624cbe59b3 Fixed the NixOS module for webdocs, try 2 2023-09-07 00:19:23 +02:00
Felix Krause fcbeb66476 Fixed the NixOS module for webdocs 2023-09-07 00:13:11 +02:00
Felix Krause 9ed6fd60f0 Final changes for NimYAML 2.0.0
* updated nimble to require Nim 2.0
 * updated some docs
 * wrote changelog
 * improved Flake
2023-09-06 23:59:40 +02:00
Felix Krause fe4449aaec Fixed server, improved docs
* made docs server compile again
 * improved migrating documenattion
 * improved CSS for mobile devices
 * fixed GitHub link
2023-09-04 22:48:04 +02:00
Felix Krause 879c7adfc0 Updated documentation. Fixed CI 2023-08-30 22:48:58 +02:00
Felix Krause 1597efa90a Don't generate anchors at comptime when dumping
* this is a prerequisite to getting dumping to work,
   but dumping is still blocked by #138
2023-08-30 21:40:20 +02:00
Felix Krause f60725fc93 Made loading work at compile time
* dumping doesn't work at CT
 * timestamps don't work at CT
 * aliases don't work at CT
 * renamed tserialization -> tnative to mirror rename of native.nim file
 * added comptime tests to tnative, currently only execute when doing
   nim nativeTests, because of compiler bug
 * Fixes #70, #91
2023-08-30 21:14:31 +02:00
Felix Krause d5aed71d38 Added raises annotations. Fixes #130 2023-08-30 19:56:04 +02:00
Felix Krause 940675a52e Reworked loading API
* moved load procs to yaml/loading.nim
 * moved input YamlStream into ConstructionContext
 * made ConstructionContext a non-ref object
 * harmonized code style & comments
 * renamed yaml/serialization.nim to yaml/native.nim
2023-08-29 23:23:15 +02:00
Felix Krause 18fc8ba3f5 Reworked dumping API
* removed default value objects,
   use Nim2 default vaules for fields instead.
 * moved dump procs to yaml/dumping and introduced Dumper
 * modified serialization procs to use ctx as first argument,
   so that prefix calls can be used
 * changed defaults for presentation to be more like other
   YAML implementations, e.g. no directives by default.
 * Removed deprecated procs in DOM API
 * Removed PresentationStyle – use the setXStyle procs of Dumper
   instead.
 * Fixed some warnings emerging from transitioning to Nim2
2023-08-29 20:46:26 +02:00
Felix Krause 189844a72b Rewrote large parts of presenter
* PresentationOptions has gained more fine-tuning options:
   * directivesEnd: specifies when `---` is written. ref #135
   * containers: specifies whether containers use block or flow style
   * suppressAddrs: if set, suppresses output of attributes
   * quoting: specifies how strings should be quoted
   * condenseFlow: specifies whether flow sequences should be on a
     single line
   * explicitKeys: specifies whether mapping keys should always have '?'
 * PresentationStyle is now a list of presets that set
   multiple options in PresentationOptions.
 * Does not output trailing spaces anymore. ref #135
 * Writes compact notation, i.e. a mapping in a sequence starts on the
   line with the sequence's `-`, unless attributes are written
 * Added tests for the presenter
 * Existing code might change behavior because of whitespace, `---` and
   compact notation. The API has been extended so that existing code is
   affected as little as possible.
2023-07-31 19:16:24 +02:00
Felix Krause 84e59c16d4 fixed tjson to conform to new type hints 2023-04-10 17:18:14 +02:00
theamarin ee7dc11a90
Adapt type hinting to Yaml 1.2.2 (#132)
Updated type hinting for YAML 1.2.

 * previously outdated regexes from YAML 1.1 were used.
 * removed special cases for leading zeros that are not part of YAML 1.2.
 * updated literal regexes for infinity, NaN and boolean values.
 * added tests for type hinting

Co-authored-by: theamarin <theamarin@thecreation.de>
2023-04-10 17:17:03 +02:00
Felix Krause 4bd8216bb1 Dump fields of parent types. ref #131 2023-04-04 20:07:12 +02:00
Felix Krause 576cf11d81 Can load fields of parent types. ref #131
* dumping fields of parent types not working yet
2023-04-04 19:29:20 +02:00
Felix Krause 8e1b07975b Fixed a bug with objects with no fields
* can now be loaded properly
 * ref #130
2023-03-18 14:50:38 +01:00
Felix Krause 39444f6536 Consolidated exceptions 2023-03-18 13:54:45 +01:00
Felix Krause f6e09ebb6a Fixed server to return proper error messages 2023-03-13 22:52:59 +01:00
Felix Krause 034b9b8453 Reworked some exceptions and compiler warnings
* LexerError is properly rewritten as YamlParserError in parser
 * updated some code to remove warnings and hints that got emitted
 * Fixes #129
2023-03-13 22:06:07 +01:00
Felix Krause ab3ff9fad4 updated changelog & readme, v1.1.0 2023-03-10 22:56:27 +01:00
Felix Krause 300dbce72a Updated test suite, fixed lexer issues 2023-03-10 22:21:18 +01:00
Felix Krause f692a47820 Skip ignored nested collections. Fixes #127 2023-03-10 19:57:21 +01:00
xflywind 7dd8e88639 make nimyaml works with stricteffects 2022-10-14 21:41:51 +02:00
Felix Krause 3e2f92c753 Fixed a bug in float deserialization.
* fixes #124
2022-09-07 16:54:11 +02:00
Felix Krause 7942e0a650 Fixed a bug in uint deserialization.
* fixes #123
2022-09-07 16:50:45 +02:00
Felix Krause 4ca3239e14 Fixed error handling for previous feature
* ref #117
2022-09-07 16:38:11 +02:00
Felix Krause 7bd562e37e Fixes and improvements to DOM API.
* added loadFlattened. Fixes #117
 * fixed an error where recursive nodes were not loaded
   properly into YamlNodes.
 * made dump with asNone raise an error when a cycle is
   encountered, instead of running into an endless loop.
2022-09-07 16:23:50 +02:00
Felix Krause 5f7677d914 Improved presenter.
* added maxLineLength to PresentationOptions. Fixes #119
 * write a newline to the end of the document.
   required for the output files to be POSIX-compliant text files.
   also improves QoL when dumping to stdout.
2022-09-07 15:15:55 +02:00
xflywind a5552a1a18 replace shallowCopy for ARC/ORC 2022-08-29 16:30:26 +02:00
metagn c7d8aa6467 Change deprecated type pragma syntax
Sorry that this messes with the style here, but it would be nice to have this syntax removed given how long it's been deprecated (https://github.com/nim-lang/Nim/pull/20199).
2022-08-11 09:14:42 +02:00
Felix Krause 947207dd02 added marks and styles to YamlNode 2022-08-02 19:46:58 +02:00