Speed up whitespace handling

This commit is contained in:
Hackerpilot 2014-01-15 03:31:06 +00:00
parent 442001d731
commit d83518e236
2 changed files with 3 additions and 4 deletions

View File

@ -581,8 +581,9 @@ public struct DLexer(R)
break loop;
}
} while (!range.empty);
return Token(tok!"whitespace", cache.cacheGet(range.slice(mark)), line,
column, index);
string text = config.whitespaceBehavior == WhitespaceBehavior.skip
? null : cache.cacheGet(range.slice(mark));
return Token(tok!"whitespace", text, line, column, index);
}
Token lexNumber() pure nothrow

View File

@ -272,8 +272,6 @@ mixin template Lexer(R, IDType, Token, alias defaultTokenFunction,
Token _front;
}
debug = 1;
struct LexerRange(BufferType) if (isBuffer!BufferType)
{
this(BufferType r)