From d6ace28775c95e7302fa5826466a014b5642abe9 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Tue, 14 Feb 2017 22:30:48 +0100 Subject: [PATCH] (hopefully) final event output fix --- yaml/parser.nim | 5 ++++- yaml/stream.nim | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/yaml/parser.nim b/yaml/parser.nim index b81d82c..a2887be 100644 --- a/yaml/parser.nim +++ b/yaml/parser.nim @@ -1120,7 +1120,10 @@ proc display*(p: YamlParser, event: YamlStreamEvent): string result = "+DOC" when defined(yamlScalarRepInd): if event.explicitDirectivesEnd: result &= " ---" - of yamlEndDoc: result = "-DOC" + of yamlEndDoc: + result = "-DOC" + when defined(yamlScalarRepInd): + if event.explicitDocumentEnd: result &= " ..." of yamlStartMap: result = "+MAP" & p.renderAttrs(event.mapTag, event.mapAnchor, true) of yamlStartSeq: diff --git a/yaml/stream.nim b/yaml/stream.nim index faa48d1..b7da231 100644 --- a/yaml/stream.nim +++ b/yaml/stream.nim @@ -270,7 +270,10 @@ proc `$`*(event: YamlStreamEvent): string {.raises: [].} = result = "+DOC" when defined(yamlScalarRepInd): if event.explicitDirectivesEnd: result &= " ---" - of yamlEndDoc: result = "-DOC" + of yamlEndDoc: + result = "-DOC" + when defined(yamlScalarRepInd): + if event.explicitDocumentEnd: result &= " ..." of yamlStartMap: result = "+MAP" & renderAttrs(event.mapTag, event.mapAnchor) of yamlStartSeq: result = "+SEQ" & renderAttrs(event.seqTag, event.seqAnchor) of yamlScalar: