mirror of https://github.com/status-im/NimYAML.git
Fixed compilation error
This commit is contained in:
parent
e30739fb36
commit
83efb88978
|
@ -252,7 +252,7 @@ proc `==`*(left: YamlStreamEvent, right: YamlStreamEvent): bool {.raises: [].} =
|
||||||
left.scalarContent == right.scalarContent
|
left.scalarContent == right.scalarContent
|
||||||
of yamlAlias: result = left.aliasTarget == right.aliasTarget
|
of yamlAlias: result = left.aliasTarget == right.aliasTarget
|
||||||
|
|
||||||
proc renderAttrs(tag: TagId, anchor: AnchorId): string =
|
proc renderAttrs(tag: TagId, anchor: AnchorId, isPlain: bool = true): string =
|
||||||
result = ""
|
result = ""
|
||||||
if anchor != yAnchorNone: result &= " &" & $anchor
|
if anchor != yAnchorNone: result &= " &" & $anchor
|
||||||
case tag
|
case tag
|
||||||
|
@ -280,14 +280,19 @@ proc `$`*(event: YamlStreamEvent): string {.raises: [].} =
|
||||||
of yamlStartMap: result = "+MAP" & renderAttrs(event.mapTag, event.mapAnchor)
|
of yamlStartMap: result = "+MAP" & renderAttrs(event.mapTag, event.mapAnchor)
|
||||||
of yamlStartSeq: result = "+SEQ" & renderAttrs(event.seqTag, event.seqAnchor)
|
of yamlStartSeq: result = "+SEQ" & renderAttrs(event.seqTag, event.seqAnchor)
|
||||||
of yamlScalar:
|
of yamlScalar:
|
||||||
result = "=VAL" & renderAttrs(event.scalarTag, event.scalarAnchor)
|
|
||||||
when defined(yamlScalarRepInd):
|
when defined(yamlScalarRepInd):
|
||||||
|
result = "=VAL" & renderAttrs(event.scalarTag, event.scalarAnchor,
|
||||||
|
event.scalarRep == srPlain)
|
||||||
case event.scalarRep
|
case event.scalarRep
|
||||||
of srPlain: result &= " :"
|
of srPlain: result &= " :"
|
||||||
of srSingleQuoted: result &= " \'"
|
of srSingleQuoted: result &= " \'"
|
||||||
of srDoubleQuoted: result &= " \""
|
of srDoubleQuoted: result &= " \""
|
||||||
of srLiteral: result &= " |"
|
of srLiteral: result &= " |"
|
||||||
of srFolded: result &= " >"
|
of srFolded: result &= " >"
|
||||||
|
else:
|
||||||
|
result = "=VAL" & renderAttrs(event.scalarTag, event.scalarAnchor,
|
||||||
|
false)
|
||||||
|
if event.scalarTag == yTagExclamationmark: result &= " \""
|
||||||
else: result &= " :"
|
else: result &= " :"
|
||||||
result &= yamlTestSuiteEscape(event.scalarContent)
|
result &= yamlTestSuiteEscape(event.scalarContent)
|
||||||
of yamlAlias: result = "=ALI *" & $event.aliasTarget
|
of yamlAlias: result = "=ALI *" & $event.aliasTarget
|
||||||
|
|
Loading…
Reference in New Issue