Minor refactoring.

This commit is contained in:
Patrick Lühne 2017-08-31 19:04:10 +02:00
parent 0a104d222c
commit 1dee4655a7
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -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;
} }