Fixed bug in dot parsing

This commit is contained in:
Hackerpilot 2014-01-23 02:38:30 -08:00
parent 3eaf095625
commit 76fc800d30
1 changed files with 2 additions and 3 deletions

View File

@ -1377,13 +1377,12 @@ public struct DLexer
Token lexDot() pure nothrow Token lexDot() pure nothrow
{ {
mixin (tokenStart); mixin (tokenStart);
auto lookahead = range.peek(1); if (!range.canPeek(1))
if (lookahead.length == 0)
{ {
range.popFront(); range.popFront();
return Token(tok!".", null, line, column, index); return Token(tok!".", null, line, column, index);
} }
switch (lookahead[0]) switch (range.peekAt(1))
{ {
case '0': .. case '9': case '0': .. case '9':
return lexNumber(); return lexNumber();