adapting the lexer for curlysyn

This commit is contained in:
Araq 2016-10-12 17:52:29 +02:00
commit 6ade7c0e0d

View file

@ -127,7 +127,7 @@ type
# this is needed because scanning comments # this is needed because scanning comments
# needs so much look-ahead # needs so much look-ahead
currLineIndent*: int currLineIndent*: int
strongSpaces*: bool strongSpaces*, allowTabs*: bool
errorHandler*: TErrorHandler errorHandler*: TErrorHandler
var gLinesCompiled*: int # all lines that have been compiled var gLinesCompiled*: int # all lines that have been compiled
@ -915,7 +915,7 @@ proc skip(L: var TLexer, tok: var TToken) =
inc(pos) inc(pos)
inc(tok.strongSpaceA) inc(tok.strongSpaceA)
of '\t': of '\t':
lexMessagePos(L, errTabulatorsAreNotAllowed, pos) if not L.allowTabs: lexMessagePos(L, errTabulatorsAreNotAllowed, pos)
inc(pos) inc(pos)
of CR, LF: of CR, LF:
pos = handleCRLF(L, pos) pos = handleCRLF(L, pos)