From 8abe91cb321c61ad330f7f66b9d3d072d0be284f Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Tue, 14 Feb 2017 22:08:38 +0100 Subject: [PATCH] Further event output improvements --- yaml/parser.nim | 4 ++-- yaml/stream.nim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yaml/parser.nim b/yaml/parser.nim index faaabdb..9f868c5 100644 --- a/yaml/parser.nim +++ b/yaml/parser.nim @@ -1090,14 +1090,14 @@ proc anchorName*(p: YamlParser, anchor: AnchorId): string {.raises: [].} = proc renderAttrs(p: YamlParser, tag: TagId, anchor: AnchorId, isPlain: bool): string = result = "" + if anchor != yAnchorNone: result &= " &" & p.anchorName(anchor) case tag of yTagQuestionmark: discard of yTagExclamationmark: when defined(yamlScalarRepInd): if isPlain: result &= " " else: - result = "<" & p.taglib.uri(tag) & ">" - if anchor != yAnchorNone: result &= " &" & p.anchorName(anchor) + result = " <" & p.taglib.uri(tag) & ">" proc display*(p: YamlParser, event: YamlStreamEvent): string {.raises: [KeyError].} = diff --git a/yaml/stream.nim b/yaml/stream.nim index 1ac4e65..afed9ea 100644 --- a/yaml/stream.nim +++ b/yaml/stream.nim @@ -251,11 +251,11 @@ proc `==`*(left: YamlStreamEvent, right: YamlStreamEvent): bool {.raises: [].} = proc renderAttrs(tag: TagId, anchor: AnchorId): string = result = "" + if anchor != yAnchorNone: result &= " &" & $anchor case tag of yTagQuestionmark: discard of yTagExclamationmark: result &= " !" else: result &= " <" & $tag & ">" - if anchor != yAnchorNone: result &= " &" & $anchor proc `$`*(event: YamlStreamEvent): string {.raises: [].} = ## outputs a human-readable string describing the given event.