Skip to content

Commit

Permalink
Make DefinesProxy use ContinueDefine method instead of duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Clang Format committed Dec 23, 2023
1 parent 9dc7ce2 commit 2a8cc56
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions src/Parser/Parsing/Impl/DefinesStreamProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,26 +240,11 @@ bool DefinesStreamProxy::MatchDefineDirective(const ParserLine& line, const unsi
MatchDefineParameters(line, currentPos);
SkipWhitespace(line, currentPos);

const auto lineEndEscapePos = GetLineEndEscapePos(line);
if (lineEndEscapePos < 0)
{
std::string value;
if (currentPos < line.m_line.size())
value = line.m_line.substr(currentPos);
m_in_define = true;
m_current_define = Define(name, std::string());
m_current_define_value.str(std::string());

Define define(name, value);
define.IdentifyParameters(m_current_define_parameters);
AddDefine(std::move(define));
}
else
{
m_in_define = true;
m_current_define = Define(name, std::string());
m_current_define_value.str(std::string());

if (currentPos < line.m_line.size() && (currentPos) < static_cast<unsigned>(lineEndEscapePos))
m_current_define_value << line.m_line.substr(currentPos, static_cast<unsigned>(lineEndEscapePos) - (currentPos));
}
ContinueDefine(line, currentPos);

return true;
}
Expand Down

0 comments on commit 2a8cc56

Please sign in to comment.