Reordered constructor parameters of VariableDeclaration.

This commit is contained in:
2017-05-30 16:27:45 +02:00
parent 9a3c85dc83
commit f78c0e4da5
4 changed files with 5 additions and 5 deletions

View File

@@ -302,7 +302,7 @@ struct VariableDeclaration
{
}
explicit VariableDeclaration(std::string &&name, Type type)
explicit VariableDeclaration(Type type, std::string &&name)
: type{type},
name{std::move(name)}
{

View File

@@ -63,7 +63,7 @@ struct StatementVisitor
{
// TODO: drop name
auto variableName = "#" + std::string(HeadVariablePrefix) + std::to_string(ruleContext.freeVariables.size() + 1);
auto variableDeclaration = std::make_unique<ast::VariableDeclaration>(std::move(variableName), ast::VariableDeclaration::Type::Head);
auto variableDeclaration = std::make_unique<ast::VariableDeclaration>(ast::VariableDeclaration::Type::Head, std::move(variableName));
ruleContext.freeVariables.emplace_back(std::move(variableDeclaration));
}

View File

@@ -93,7 +93,7 @@ struct TermTranslateVisitor
if (!isUndeclared)
return ast::Term::make<ast::Variable>(*matchingVariableDeclaration);
auto variableDeclaration = std::make_unique<ast::VariableDeclaration>(std::string(variable.name), ast::VariableDeclaration::Type::UserDefined);
auto variableDeclaration = std::make_unique<ast::VariableDeclaration>(ast::VariableDeclaration::Type::UserDefined, std::string(variable.name));
ruleContext.freeVariables.emplace_back(std::move(variableDeclaration));
return ast::Term::make<ast::Variable>(ruleContext.freeVariables.back().get());