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