Minor refactoring.
This commit is contained in:
parent
0a104d222c
commit
1dee4655a7
@ -21,17 +21,13 @@ std::experimental::optional<ast::Term> parseTerm(Context &context, ASTContext &a
|
|||||||
|
|
||||||
tokenizer.skipWhiteSpace();
|
tokenizer.skipWhiteSpace();
|
||||||
|
|
||||||
// TODO: refactor
|
std::experimental::optional<ast::Term> term;
|
||||||
auto variable = parseVariable(context, variableStack);
|
|
||||||
|
|
||||||
if (variable)
|
if ((term = parseVariable(context, variableStack))
|
||||||
return std::move(variable.value());
|
|| (term = parseConstant(context, astContext)))
|
||||||
|
{
|
||||||
// Parse argument if it is a constant
|
return std::move(term.value());
|
||||||
auto constant = parseConstant(context, astContext);
|
}
|
||||||
|
|
||||||
if (constant)
|
|
||||||
return std::move(constant.value());
|
|
||||||
|
|
||||||
return std::experimental::nullopt;
|
return std::experimental::nullopt;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user