From 76fc800d30d6ca0b196e503ad1eff1c1069ec437 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Thu, 23 Jan 2014 02:38:30 -0800 Subject: [PATCH] Fixed bug in dot parsing --- stdx/d/lexer.d | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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();