Fixed a bug with indentation after block scalar

This commit is contained in:
Felix Krause 2016-03-11 18:09:34 +01:00
parent afc5306da5
commit e1cee73b27
1 changed files with 5 additions and 3 deletions

View File

@ -158,9 +158,8 @@ template closeMoreIndentedLevels(atSequenceItem: bool = false) {.dirty.} =
debug("Closing because parent.indentation (" & $parent.indentation &
") >= indentation(" & $indentation & ")")
yieldLevelEnd()
handleObjectEnd(fpBlockAfterObject)
else:
break
handleObjectEnd(state)
else: break
template closeEverything() {.dirty.} =
indentation = 0
@ -1345,6 +1344,9 @@ proc parse*(p: YamlParser, s: Stream): YamlStream =
if tag == yTagQuestionMark: tag = yTagExclamationMark
yield scalarEvent(content, tag, anchor)
handleObjectEnd(stateAfter)
if stateAfter == fpBlockObjectStart:
indentation = p.lexer.getColNumber(p.lexer.bufpos)
closeMoreIndentedLevels()
of '-':
if p.lexer.isPlainSafe(p.lexer.bufpos + 1, cBlock):
handleBlockItemStart()