mirror of https://github.com/status-im/NimYAML.git
properly handle comment after block scalars. fixes #106
This commit is contained in:
parent
5aa39aa0f1
commit
8993f928d4
|
@ -572,10 +572,9 @@ proc readBlockScalar(lex: var Lexer) =
|
||||||
|
|
||||||
let markerFollows = lex.currentIndentation() == 0 and
|
let markerFollows = lex.currentIndentation() == 0 and
|
||||||
(lex.dirEndFollows() or lex.docEndFollows())
|
(lex.dirEndFollows() or lex.docEndFollows())
|
||||||
if lex.currentIndentation() > lex.indentation and not markerFollows:
|
|
||||||
if lex.c == '#':
|
if lex.c == '#':
|
||||||
lex.state = expectLineEnd
|
lex.state = expectLineEnd
|
||||||
else:
|
elif lex.currentIndentation() > lex.indentation and not markerFollows:
|
||||||
raise lex.generateError("This line #" & $lex.curStartPos.line & " at " & escape("" & lex.c) & " is less indented than necessary")
|
raise lex.generateError("This line #" & $lex.curStartPos.line & " at " & escape("" & lex.c) & " is less indented than necessary")
|
||||||
elif lex.currentIndentation() == 0:
|
elif lex.currentIndentation() == 0:
|
||||||
lex.state = lineStart
|
lex.state = lineStart
|
||||||
|
|
Loading…
Reference in New Issue