Skip to content

Commit

Permalink
Change name to match other names and avoid lint error
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Aug 19, 2024
1 parent b586a36 commit 8266d2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Checks: '*include*,
bugprone-narrowing-conversions,
bugprone-switch-missing-default-case,
cert-err33-c,
readability-suspicious-call-argument,
readability-isolate-declaration,
readability-redundant-member-init,
readability-named-parameter,
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,11 +919,11 @@ __attribute__((noreturn)) void Parser::parseError(const char* msg,
std::string msgWithMeta =
"%(file)s:%(line)d:%(column)d: error: " + std::string(msg);

std::string foundStr;
std::string found;
if (_PRINTABLE_SYM) {
foundStr = symnames[sym] + std::string(" (") + text + ")";
found = symnames[sym] + std::string(" (") + text + ")";
} else {
foundStr = symnames[sym];
found = symnames[sym];
}

ReplacePattern(msgWithMeta, "%(file)s", fname);
Expand All @@ -934,7 +934,7 @@ __attribute__((noreturn)) void Parser::parseError(const char* msg,
std::string column = std::to_string(lexer.GetCurrentColumn());
ReplacePattern(msgWithMeta, "%(column)d", column);
ReplacePattern(msgWithMeta, "%(expected)s", expected);
ReplacePattern(msgWithMeta, "%(found)s", foundStr);
ReplacePattern(msgWithMeta, "%(found)s", found);

ErrorPrint(msgWithMeta);
Quit(ERR_FAIL);
Expand Down

0 comments on commit 8266d2f

Please sign in to comment.