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
6 changes: 3 additions & 3 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,10 @@ static bool isStringLiteralPrefix(const std::string &str)
str == "R" || str == "uR" || str == "UR" || str == "LR" || str == "u8R";
}

void simplecpp::TokenList::lineDirective(unsigned int fileIndex, unsigned int line, Location &location)
void simplecpp::TokenList::lineDirective(unsigned int fileId, unsigned int line, Location &location)
{
if (fileIndex != location.fileIndex || line >= location.line) {
location.fileIndex = fileIndex;
if (fileId != location.fileIndex || line >= location.line) {
location.fileIndex = fileId;
location.line = line;
return;
}
Expand Down
8 changes: 4 additions & 4 deletions simplecpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ namespace simplecpp {
bool isOneOf(const char ops[]) const;
bool startsWithOneOf(const char c[]) const;
bool endsWithOneOf(const char c[]) const;
static bool isNumberLike(const std::string& str) {
return std::isdigit(static_cast<unsigned char>(str[0])) ||
(str.size() > 1U && (str[0] == '-' || str[0] == '+') && std::isdigit(static_cast<unsigned char>(str[1])));
static bool isNumberLike(const std::string& s) {
return std::isdigit(static_cast<unsigned char>(s[0])) ||
(s.size() > 1U && (s[0] == '-' || s[0] == '+') && std::isdigit(static_cast<unsigned char>(s[1])));
}

TokenString macro;
Expand Down Expand Up @@ -396,7 +396,7 @@ namespace simplecpp {
void constFoldQuestionOp(Token *&tok1);

std::string readUntil(Stream &stream, const Location &location, char start, char end, OutputList *outputList);
void lineDirective(unsigned int fileIndex, unsigned int line, Location &location);
void lineDirective(unsigned int fileId, unsigned int line, Location &location);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That change is a bit problematic because "fileIndex" has a special meaning within simplecpp and that would get lost...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A rather awkward solution would be using fileIndex_. Maybe somebody else could chime in...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And on side note - as index and ID are different things it should have been changed to fileIdx.

const Token* lastLineTok(int maxsize=1000) const;
const Token* isLastLinePreprocessor(int maxsize=1000) const;
Expand Down
Loading