diff --git a/private/fastparse.nim b/private/fastparse.nim index 5d4c131..533185d 100644 --- a/private/fastparse.nim +++ b/private/fastparse.nim @@ -492,6 +492,10 @@ template tagUri(lexer: BaseLexer, uri: var string) = while lexer.buf[lexer.bufpos] in space: lexer.bufpos.inc() var c = lexer.buf[lexer.bufpos] + if c == '!': + uri.add(c) + lexer.bufpos.inc() + c = lexer.buf[lexer.bufpos] while c notin spaceOrLineEnd: case c of 'a' .. 'z', 'A' .. 'Z', '0' .. '9', '#', ';', '/', '?', ':', '@', '&', @@ -964,7 +968,7 @@ template blockScalar(lexer: BaseLexer, content: var string, of EndOfFile: stateAfter = fpBlockLineStart break outer - of ' ': + of ' ', '\t': if not literal: if not recentLineMoreIndented: recentLineMoreIndented = true diff --git a/test/testEventParser.nim b/test/testEventParser.nim index c36bb43..84ddb1a 100644 --- a/test/testEventParser.nim +++ b/test/testEventParser.nim @@ -63,6 +63,8 @@ proc nextToken(lex: var EventLexer): LexerToken = while lex.buf[lex.bufpos] != '>': lex.content.add(lex.buf[lex.bufpos]) lex.bufpos.inc() + if lex.buf[lex.bufpos] == EndOfFile: + raise newException(EventStreamError, "Unclosed tag URI!") result = chevTag lex.bufpos.inc() of '&':