Avoiding empty arguments in n-ary expressions.
This commit is contained in:
parent
2c3481d027
commit
fdbcb261df
@ -83,6 +83,9 @@ std::unique_ptr<Derived> NAry<Derived>::parse(Context &context,
|
|||||||
template<class Derived>
|
template<class Derived>
|
||||||
void NAry<Derived>::addArgument(const Expression *argument)
|
void NAry<Derived>::addArgument(const Expression *argument)
|
||||||
{
|
{
|
||||||
|
if (!argument)
|
||||||
|
return;
|
||||||
|
|
||||||
m_arguments.emplace_back(argument);
|
m_arguments.emplace_back(argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +94,9 @@ void NAry<Derived>::addArgument(const Expression *argument)
|
|||||||
template<class Derived>
|
template<class Derived>
|
||||||
void NAry<Derived>::addArgument(ExpressionPointer &&argument)
|
void NAry<Derived>::addArgument(ExpressionPointer &&argument)
|
||||||
{
|
{
|
||||||
|
if (!argument)
|
||||||
|
return;
|
||||||
|
|
||||||
m_argumentStorage.emplace_back(std::move(argument));
|
m_argumentStorage.emplace_back(std::move(argument));
|
||||||
m_arguments.emplace_back(m_argumentStorage.back().get());
|
m_arguments.emplace_back(m_argumentStorage.back().get());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user