Skip to content

Commit

Permalink
removed default argument of type
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Feb 17, 2024
1 parent e2357a3 commit fc20ff9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/loki/domain/pddl/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TypeImpl : public Base<TypeImpl> {
std::string m_name;
TypeList m_bases;

TypeImpl(int identifier, std::string name, TypeList bases = {});
TypeImpl(int identifier, std::string name, TypeList bases);

// Give access to the constructor.
template<typename HolderType, ElementsPerSegment N>
Expand Down
4 changes: 2 additions & 2 deletions src/domain/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ DomainParser::DomainParser(const fs::path& file_path)
context.scopes.open_scope();

// Create base types.
const auto base_type_object = context.factories.types.get_or_create<pddl::TypeImpl>("object");
const auto base_type_number = context.factories.types.get_or_create<pddl::TypeImpl>("number");
const auto base_type_object = context.factories.types.get_or_create<pddl::TypeImpl>("object", pddl::TypeList());
const auto base_type_number = context.factories.types.get_or_create<pddl::TypeImpl>("number", pddl::TypeList());
context.scopes.insert("object", base_type_object, {});
context.scopes.insert("number", base_type_number, {});

Expand Down
2 changes: 1 addition & 1 deletion src/domain/pddl/parser/parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ParameterListVisitor::ParameterListVisitor(Context& context_)

pddl::ParameterList ParameterListVisitor::operator()(const std::vector<ast::Variable>& nodes) {
// std::vector<ast::Variable> has single base type "object"
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>("object");
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>("object", pddl::TypeList());
auto parameter_list = parse_parameter_definitions(nodes, pddl::TypeList{type}, context);
return parameter_list;
}
Expand Down
6 changes: 3 additions & 3 deletions src/domain/pddl/parser/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ TypeDeclarationTypeVisitor::TypeDeclarationTypeVisitor(Context& context_)
: context(context_) { }

pddl::TypeList TypeDeclarationTypeVisitor::operator()(const ast::TypeObject& node) {
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>("object");
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>("object", pddl::TypeList());
context.positions.push_back(type, node);
return { type };
}

pddl::TypeList TypeDeclarationTypeVisitor::operator()(const ast::TypeNumber& node) {
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>("number");
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>("number", pddl::TypeList());
context.positions.push_back(type, node);
return { type };
}

pddl::TypeList TypeDeclarationTypeVisitor::operator()(const domain::ast::Name& node) {
auto name = parse(node);
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>(name);
const auto type = context.factories.types.get_or_create<pddl::TypeImpl>(name, pddl::TypeList());
context.positions.push_back(type, node);
return { type };
}
Expand Down

0 comments on commit fc20ff9

Please sign in to comment.