From de28502bb1b6e45eefc1f2f9e1794c2258f7064a Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Mon, 19 Jan 2009 18:51:27 +0000 Subject: [PATCH] Fixed bug in line numbers and enabled test case that spots it. --- src/tokenize.cpp | 3 ++- test/testtokenize.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index ea47c3fee..bb42bbc37 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -354,6 +354,7 @@ void Tokenizer::tokenizeCode(std::istream &code, unsigned int FileIndex) } // Has this file been tokenized already? + ++lineno; bool foundOurfile = false; for (unsigned int i = 0; i < _files.size(); i++) { @@ -372,7 +373,7 @@ void Tokenizer::tokenizeCode(std::istream &code, unsigned int FileIndex) fileIndexes.push_back(lineno); } - lineno = 0; + lineno = 1; FileIndex = fileIndexes.size() - 1; continue; } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 8cd076ded..9326b5271 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -67,7 +67,7 @@ private: TEST_CASE(varid1); TEST_CASE(varid2); - // TODO TEST_CASE(file1); + TEST_CASE(file1); }