Reordered constructor parameters of VariableDeclaration.
This commit is contained in:
@@ -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)}
|
||||
{
|
||||
|
@@ -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));
|
||||
}
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user