mirror of https://github.com/status-im/NimYAML.git
Further event output improvements
This commit is contained in:
parent
2bb32139c4
commit
8abe91cb32
|
@ -1090,6 +1090,7 @@ 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:
|
||||
|
@ -1097,7 +1098,6 @@ proc renderAttrs(p: YamlParser, tag: TagId, anchor: AnchorId,
|
|||
if isPlain: result &= " <!>"
|
||||
else:
|
||||
result = " <" & p.taglib.uri(tag) & ">"
|
||||
if anchor != yAnchorNone: result &= " &" & p.anchorName(anchor)
|
||||
|
||||
proc display*(p: YamlParser, event: YamlStreamEvent): string
|
||||
{.raises: [KeyError].} =
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue