mirror of https://github.com/status-im/NimYAML.git
Fixes #35
This commit is contained in:
parent
538a2d2deb
commit
b99fa8df7a
|
@ -592,17 +592,24 @@ parserState blockObjectStart:
|
||||||
c.advance()
|
c.advance()
|
||||||
state = scalarEnd
|
state = scalarEnd
|
||||||
of ltScalarPart:
|
of ltScalarPart:
|
||||||
|
let needsValueIndicator = c.level.kind == fplMapKey
|
||||||
result = c.handleBlockItemStart(e)
|
result = c.handleBlockItemStart(e)
|
||||||
c.plainScalarStart = c.lex.curStartPos
|
c.plainScalarStart = c.lex.curStartPos
|
||||||
while true:
|
while true:
|
||||||
c.advance()
|
c.advance()
|
||||||
case c.lex.cur
|
case c.lex.cur
|
||||||
of ltIndentation:
|
of ltIndentation:
|
||||||
if c.lex.indentation <= c.ancestry[^1].indentation: break
|
if c.lex.indentation <= c.ancestry[^1].indentation:
|
||||||
|
if needsValueIndicator and
|
||||||
|
c.lex.indentation == c.ancestry[^1].indentation:
|
||||||
|
raise c.generateError("Illegal multiline implicit key")
|
||||||
|
break
|
||||||
c.lex.newlines.inc()
|
c.lex.newlines.inc()
|
||||||
of ltScalarPart: discard
|
of ltScalarPart: discard
|
||||||
of ltEmptyLine: c.lex.newlines.inc()
|
of ltEmptyLine: c.lex.newlines.inc()
|
||||||
else: break
|
else: break
|
||||||
|
if needsValueIndicator and c.lex.cur != ltMapValInd:
|
||||||
|
raise c.generateError("Missing mapping value indicator (`:`)")
|
||||||
c.lex.newlines = 0
|
c.lex.newlines = 0
|
||||||
state = plainScalarEnd
|
state = plainScalarEnd
|
||||||
stored = blockAfterObject
|
stored = blockAfterObject
|
||||||
|
|
Loading…
Reference in New Issue