mirror of https://github.com/status-im/NimYAML.git
Fixed bug with indentation parsing
This commit is contained in:
parent
e307cbbad5
commit
b8afc8b9d9
|
@ -267,8 +267,10 @@ template handleBlockIndicator(expected, possible: openarray[DocumentLevelMode],
|
||||||
|
|
||||||
template startPlainScalar() {.dirty.} =
|
template startPlainScalar() {.dirty.} =
|
||||||
level.mode = mScalar
|
level.mode = mScalar
|
||||||
|
level.indentationColumn = lex.column
|
||||||
scalarCache = lex.content
|
scalarCache = lex.content
|
||||||
scalarCacheType = lex.typeHint
|
scalarCacheType = lex.typeHint
|
||||||
|
scalarIndentation = lex.column
|
||||||
state = ypBlockAfterScalar
|
state = ypBlockAfterScalar
|
||||||
|
|
||||||
template handleTagHandle() {.dirty.} =
|
template handleTagHandle() {.dirty.} =
|
||||||
|
@ -536,7 +538,6 @@ proc parse*(parser: YamlSequentialParser,
|
||||||
of tColon:
|
of tColon:
|
||||||
assert level.mode in [mUnknown, mImplicitBlockMapKey, mScalar]
|
assert level.mode in [mUnknown, mImplicitBlockMapKey, mScalar]
|
||||||
if level.mode in [mUnknown, mScalar]:
|
if level.mode in [mUnknown, mScalar]:
|
||||||
level.indentationColumn = scalarIndentation
|
|
||||||
# tags and anchors are for key scalar, not for map.
|
# tags and anchors are for key scalar, not for map.
|
||||||
yield YamlParserEvent(kind: yamlStartMap,
|
yield YamlParserEvent(kind: yamlStartMap,
|
||||||
objAnchor: anchorNone,
|
objAnchor: anchorNone,
|
||||||
|
@ -955,7 +956,6 @@ proc parse*(parser: YamlSequentialParser,
|
||||||
indentationColumn: -1)
|
indentationColumn: -1)
|
||||||
state = ypFlow
|
state = ypFlow
|
||||||
else:
|
else:
|
||||||
echo "level.mode = ", level.mode
|
|
||||||
yieldUnexpectedToken()
|
yieldUnexpectedToken()
|
||||||
of tClosingBrace:
|
of tClosingBrace:
|
||||||
if level.mode != mFlowMapValue:
|
if level.mode != mFlowMapValue:
|
||||||
|
|
Loading…
Reference in New Issue