fix bool serialization

output `true` or `false` instead of `y` and `n` to comply with the YAML 1.2 spec.
This commit is contained in:
flyx 2021-03-23 13:20:48 +01:00 committed by GitHub
parent fcae534148
commit 03ecab0075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -318,7 +318,7 @@ proc constructObject*(s: var YamlStream, c: ConstructionContext,
proc representObject*(value: bool, ts: TagStyle, c: SerializationContext,
tag: Tag) {.raises: [].} =
## represents a bool value as a YAML scalar
c.put(scalarEvent(if value: "y" else: "n", tag, yAnchorNone))
c.put(scalarEvent(if value: "true" else: "false", tag, yAnchorNone))
proc constructObject*(s: var YamlStream, c: ConstructionContext,
result: var char)