mirror of https://github.com/status-im/NimYAML.git
event parser: support \b and \t escape sequences
This commit is contained in:
parent
5444572543
commit
afc5306da5
|
@ -49,6 +49,8 @@ proc nextToken(lex: var EventLexer): LexerToken =
|
||||||
of 'n': lex.content.add('\l')
|
of 'n': lex.content.add('\l')
|
||||||
of 'r': lex.content.add('\r')
|
of 'r': lex.content.add('\r')
|
||||||
of '0': lex.content.add('\0')
|
of '0': lex.content.add('\0')
|
||||||
|
of 'b': lex.content.add('\b')
|
||||||
|
of 't': lex.content.add('\t')
|
||||||
of '\\': lex.content.add('\\')
|
of '\\': lex.content.add('\\')
|
||||||
else: raise newException(EventStreamError,
|
else: raise newException(EventStreamError,
|
||||||
"Unknown escape character: " & lex.buf[lex.bufpos])
|
"Unknown escape character: " & lex.buf[lex.bufpos])
|
||||||
|
|
Loading…
Reference in New Issue