From 2c6046bd16281421564e98b01f5b0c262d02cf59 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Thu, 22 Jan 2015 18:16:00 +0300 Subject: [PATCH] fix tokenizer --- src/ddc/lexer/tokenizer.d | 7 ++----- workspaces/sample1/sampleproject1/source/main.d | Bin 358 -> 361 bytes 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ddc/lexer/tokenizer.d b/src/ddc/lexer/tokenizer.d index 60d738f..605fe68 100644 --- a/src/ddc/lexer/tokenizer.d +++ b/src/ddc/lexer/tokenizer.d @@ -1431,6 +1431,7 @@ class Tokenizer _pos = 0; _prevLineLength = 0; _lineText = null; + nextLine(); } this(string code, string filename = "") { @@ -1459,11 +1460,7 @@ class Tokenizer } protected dchar nextChar() { - if (_lineText is null) { - if (!nextLine()) { - return EOF_CHAR; - } - } else if (_pos >= _len) { + if (_pos >= _len) { if (!nextLine()) { return EOF_CHAR; } diff --git a/workspaces/sample1/sampleproject1/source/main.d b/workspaces/sample1/sampleproject1/source/main.d index 8f037da5ebf66d27105a5e529720f191582dbe76..e791fbe051b97db61cada8a46ccfe69fa0614297 100644 GIT binary patch delta 35 kcmaFH^pZ)cEI%_vAvZBIPeW6onwJX(Yk9dgiu*GH0J>2KZ~y=R delta 32 ncmaFK^o&V7iIIUpSy8{VxJW-KGfzJ?uS}sRB{yZGls_W?o}~%h