12 Commits

Author SHA1 Message Date
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
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
e3e810fce0 all tests green again 2020-11-10 19:07:46 +01:00
Felix Krause
4305bccbf0 made anchor resolution during deserialization safer 2020-11-10 14:48:19 +01:00
Felix Krause
aa65c066d5 changed TagId to Tag. removed JS stuff that wasn't working anyway. 2020-11-10 13:55:22 +01:00
Felix Krause
6238104622 started making serializationTests green again 2020-11-06 21:39:50 +01:00
Felix Krause
48d601d959 parser tests working, other tests compiling 2020-11-06 16:21:58 +01:00
Felix Krause
ae4c097a25 fixed parser test framework; started making parser tests green 2020-11-04 22:47:52 +01:00
Felix Krause
1d707b184e started updating other parts of the codebase 2020-11-03 22:08:21 +01:00
Felix Krause
05b8528f3e translated parser from AdaYaml 2020-11-03 21:17:31 +01:00