From bbf2a7d02db9701da4c8919b559c568e2af92435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sun, 18 Jun 2017 22:58:14 +0200 Subject: [PATCH] =?UTF-8?q?Allowing=20not=20declaring=20implicit=20?= =?UTF-8?q?=E2=80=9Cobject=E2=80=9D=20type=20without=20warning=20or=20erro?= =?UTF-8?q?r.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pddlparse/detail/parsing/PrimitiveType.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)));