mirror of https://github.com/status-im/NimYAML.git
Fixed small bugs
* allow '!' at beginning of tag URI in %TAG directive * recognise \t as start of more indented line in block flow scalar * Made testEventParser more robust
This commit is contained in:
parent
91cbf92650
commit
1c61486739
|
@ -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
|
||||
|
|
|
@ -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 '&':
|
||||
|
|
Loading…
Reference in New Issue