mirror of https://github.com/status-im/NimYAML.git
Fixed YAML test suite to conform to naming changes
This commit is contained in:
parent
c3f5188e5e
commit
9c251584a0
|
@ -106,14 +106,14 @@ template yieldEvent() {.dirty.} =
|
||||||
|
|
||||||
template setTag(t: TagId) {.dirty.} =
|
template setTag(t: TagId) {.dirty.} =
|
||||||
case curEvent.kind
|
case curEvent.kind
|
||||||
of yamlStartSequence: curEvent.seqTag = t
|
of yamlStartSeq: curEvent.seqTag = t
|
||||||
of yamlStartMap: curEvent.mapTag = t
|
of yamlStartMap: curEvent.mapTag = t
|
||||||
of yamlScalar: curEvent.scalarTag = t
|
of yamlScalar: curEvent.scalarTag = t
|
||||||
else: discard
|
else: discard
|
||||||
|
|
||||||
template setAnchor(a: AnchorId) {.dirty.} =
|
template setAnchor(a: AnchorId) {.dirty.} =
|
||||||
case curEvent.kind
|
case curEvent.kind
|
||||||
of yamlStartSequence: curEvent.seqAnchor = a
|
of yamlStartSeq: curEvent.seqAnchor = a
|
||||||
of yamlStartMap: curEvent.mapAnchor = a
|
of yamlStartMap: curEvent.mapAnchor = a
|
||||||
of yamlScalar: curEvent.scalarAnchor = a
|
of yamlScalar: curEvent.scalarAnchor = a
|
||||||
of yamlAlias: curEvent.aliasTarget = a
|
of yamlAlias: curEvent.aliasTarget = a
|
||||||
|
@ -122,7 +122,7 @@ template setAnchor(a: AnchorId) {.dirty.} =
|
||||||
template curTag(): TagId =
|
template curTag(): TagId =
|
||||||
var foo: TagId
|
var foo: TagId
|
||||||
case curEvent.kind
|
case curEvent.kind
|
||||||
of yamlStartSequence: foo = curEvent.seqTag
|
of yamlStartSeq: foo = curEvent.seqTag
|
||||||
of yamlStartMap: foo = curEvent.mapTag
|
of yamlStartMap: foo = curEvent.mapTag
|
||||||
of yamlScalar: foo = curEvent.scalarTag
|
of yamlScalar: foo = curEvent.scalarTag
|
||||||
else: raise newException(EventStreamError,
|
else: raise newException(EventStreamError,
|
||||||
|
@ -131,7 +131,7 @@ template curTag(): TagId =
|
||||||
|
|
||||||
template setCurTag(val: TagId) =
|
template setCurTag(val: TagId) =
|
||||||
case curEvent.kind
|
case curEvent.kind
|
||||||
of yamlStartSequence: curEvent.seqTag = val
|
of yamlStartSeq: curEvent.seqTag = val
|
||||||
of yamlStartMap: curEvent.mapTag = val
|
of yamlStartMap: curEvent.mapTag = val
|
||||||
of yamlScalar: curEvent.scalarTag = val
|
of yamlScalar: curEvent.scalarTag = val
|
||||||
else: raise newException(EventStreamError,
|
else: raise newException(EventStreamError,
|
||||||
|
@ -140,7 +140,7 @@ template setCurTag(val: TagId) =
|
||||||
template curAnchor(): AnchorId =
|
template curAnchor(): AnchorId =
|
||||||
var foo: AnchorId
|
var foo: AnchorId
|
||||||
case curEvent.kind
|
case curEvent.kind
|
||||||
of yamlStartSequence: foo = curEvent.seqAnchor
|
of yamlStartSeq: foo = curEvent.seqAnchor
|
||||||
of yamlStartMap: foo = curEvent.mapAnchor
|
of yamlStartMap: foo = curEvent.mapAnchor
|
||||||
of yamlScalar: foo = curEvent.scalarAnchor
|
of yamlScalar: foo = curEvent.scalarAnchor
|
||||||
of yamlAlias: foo = curEvent.aliasTarget
|
of yamlAlias: foo = curEvent.aliasTarget
|
||||||
|
@ -150,7 +150,7 @@ template curAnchor(): AnchorId =
|
||||||
|
|
||||||
template setCurAnchor(val: AnchorId) =
|
template setCurAnchor(val: AnchorId) =
|
||||||
case curEvent.kind
|
case curEvent.kind
|
||||||
of yamlStartSequence: curEvent.seqAnchor = val
|
of yamlStartSeq: curEvent.seqAnchor = val
|
||||||
of yamlStartMap: curEvent.mapAnchor = val
|
of yamlStartMap: curEvent.mapAnchor = val
|
||||||
of yamlScalar: curEvent.scalarAnchor = val
|
of yamlScalar: curEvent.scalarAnchor = val
|
||||||
of yamlAlias: curEvent.aliasTarget = val
|
of yamlAlias: curEvent.aliasTarget = val
|
||||||
|
@ -189,12 +189,12 @@ proc parseEventStream*(input: Stream, tagLib: TagLibrary): YamlStream =
|
||||||
if inEvent: yield curEvent
|
if inEvent: yield curEvent
|
||||||
inEvent = false
|
inEvent = false
|
||||||
streamPos = afterStream
|
streamPos = afterStream
|
||||||
of plusDoc: eventStart(yamlStartDocument)
|
of plusDoc: eventStart(yamlStartDoc)
|
||||||
of minusDoc: eventStart(yamlEndDocument)
|
of minusDoc: eventStart(yamlEndDoc)
|
||||||
of plusMap: eventStart(yamlStartMap)
|
of plusMap: eventStart(yamlStartMap)
|
||||||
of minusMap: eventStart(yamlEndMap)
|
of minusMap: eventStart(yamlEndMap)
|
||||||
of plusSeq: eventStart(yamlStartSequence)
|
of plusSeq: eventStart(yamlStartSeq)
|
||||||
of minusSeq: eventStart(yamlEndSequence)
|
of minusSeq: eventStart(yamlEndSeq)
|
||||||
of eqVal: eventStart(yamlScalar)
|
of eqVal: eventStart(yamlScalar)
|
||||||
of eqAli: eventStart(yamlAlias)
|
of eqAli: eventStart(yamlAlias)
|
||||||
of chevTag:
|
of chevTag:
|
||||||
|
|
Loading…
Reference in New Issue