diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp index 5bdc006..7f6fa38 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp @@ -33,10 +33,14 @@ ast::PrimitiveTypePointer parsePrimitiveType(Context &context, ast::Domain &doma // If the type has not been declared yet, add it but issue a warning if (matchingType == types.end()) { - if (context.mode != Mode::Compatibility) - throw ParserException(tokenizer, "primitive type “" + typeName + "” used without or before declaration"); + // “object” type is always allowed without warning + if (typeName != "object") + { + if (context.mode != Mode::Compatibility) + throw ParserException(tokenizer, "primitive type “" + typeName + "” used without or before declaration"); - context.warningCallback(tokenizer, "primitive type “" + typeName + "” used without or before declaration, silently adding declaration"); + context.warningCallback(tokenizer, "primitive type “" + typeName + "” used without or before declaration, silently adding declaration"); + } types.emplace_back(std::make_unique(std::move(typeName)));