Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ std::string simplecpp::TokenList::stringify(bool linenrs) const
{
std::ostringstream ret;
Location loc;
loc.line = 1;
bool filechg = true;
for (const Token *tok = cfront(); tok; tok = tok->next) {
if (tok->location.line < loc.line || tok->location.fileIndex != loc.fileIndex) {
Expand Down
2 changes: 1 addition & 1 deletion simplecpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace simplecpp {
}

unsigned int fileIndex{};
unsigned int line{1};
unsigned int line{};
unsigned int col{};
};

Expand Down
2 changes: 1 addition & 1 deletion test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,7 @@ static void readfile_file_not_found()
simplecpp::OutputList outputList;
std::vector<std::string> files;
(void)simplecpp::TokenList("NotAFile", files, &outputList);
ASSERT_EQUALS("file0,1,file_not_found,File is missing: NotAFile\n", toString(outputList));
ASSERT_EQUALS("file0,0,file_not_found,File is missing: NotAFile\n", toString(outputList));
}

static void stringify1()
Expand Down