Fixed a bug with setting ! in %TAG directive

This commit is contained in:
Felix Krause 2016-03-11 18:32:17 +01:00
parent e1cee73b27
commit 2e8d7b39ab
1 changed files with 2 additions and 4 deletions

View File

@ -63,8 +63,6 @@ template parserError(message: string) {.dirty.} =
e.line = p.lexer.lineNumber e.line = p.lexer.lineNumber
e.column = p.tokenstart + 1 e.column = p.tokenstart + 1
e.lineContent = p.getLineContent(true) e.lineContent = p.getLineContent(true)
echo "line ", e.line, ", column ", e.column, ": ", message
echo e.lineContent
raise e raise e
template lexerError(lx: BaseLexer, message: string) {.dirty.} = template lexerError(lx: BaseLexer, message: string) {.dirty.} =
@ -485,7 +483,7 @@ template tagShorthand(lexer: BaseLexer, shorthand: var string) =
else: else:
lexerError(lexer, "Illegal character in tag shorthand") lexerError(lexer, "Illegal character in tag shorthand")
shorthand.add(c) shorthand.add(c)
lexer.bufpos.inc() lexer.bufpos.inc()
if lexer.buf[lexer.bufpos] notin spaceOrLineEnd: if lexer.buf[lexer.bufpos] notin spaceOrLineEnd:
lexerError(lexer, "Missing space after tag shorthand") lexerError(lexer, "Missing space after tag shorthand")
@ -1050,7 +1048,7 @@ proc parse*(p: YamlParser, s: Stream): YamlStream =
startToken() startToken()
p.lexer.tagShorthand(shorthand) p.lexer.tagShorthand(shorthand)
p.lexer.tagUri(uri) p.lexer.tagUri(uri)
shorthands.add(shorthand, uri) shorthands[shorthand] = uri
p.lexer.lineEnding() p.lexer.lineEnding()
handleLineEnd(false) handleLineEnd(false)
of ldUnknown: of ldUnknown: