Speed up whitespace handling
This commit is contained in:
parent
442001d731
commit
d83518e236
|
@ -581,8 +581,9 @@ public struct DLexer(R)
|
||||||
break loop;
|
break loop;
|
||||||
}
|
}
|
||||||
} while (!range.empty);
|
} while (!range.empty);
|
||||||
return Token(tok!"whitespace", cache.cacheGet(range.slice(mark)), line,
|
string text = config.whitespaceBehavior == WhitespaceBehavior.skip
|
||||||
column, index);
|
? null : cache.cacheGet(range.slice(mark));
|
||||||
|
return Token(tok!"whitespace", text, line, column, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Token lexNumber() pure nothrow
|
Token lexNumber() pure nothrow
|
||||||
|
|
|
@ -272,8 +272,6 @@ mixin template Lexer(R, IDType, Token, alias defaultTokenFunction,
|
||||||
Token _front;
|
Token _front;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug = 1;
|
|
||||||
|
|
||||||
struct LexerRange(BufferType) if (isBuffer!BufferType)
|
struct LexerRange(BufferType) if (isBuffer!BufferType)
|
||||||
{
|
{
|
||||||
this(BufferType r)
|
this(BufferType r)
|
||||||
|
|
Loading…
Reference in New Issue