diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d0afee..8a25e16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Features: Bug Fixes: * fixes incorrectly simplified rules with comparisons +* fixes misleading error message concerning negated, unsupported body literals ## 0.1.2 (2017-03-23) diff --git a/include/anthem/Body.h b/include/anthem/Body.h index 60c6969..4f3f347 100644 --- a/include/anthem/Body.h +++ b/include/anthem/Body.h @@ -144,8 +144,11 @@ struct BodyLiteralTranslateVisitor struct BodyBodyLiteralTranslateVisitor { - std::experimental::optional visit(const Clingo::AST::Literal &literal, const Clingo::AST::BodyLiteral &, Context &context) + std::experimental::optional visit(const Clingo::AST::Literal &literal, const Clingo::AST::BodyLiteral &bodyLiteral, Context &context) { + if (bodyLiteral.sign != Clingo::AST::Sign::None) + throwErrorAtLocation(bodyLiteral.location, "only positive body literals supported currently", context); + return literal.data.accept(BodyLiteralTranslateVisitor(), literal, context); } diff --git a/include/anthem/StatementVisitor.h b/include/anthem/StatementVisitor.h index 4008a9c..de9e6a5 100644 --- a/include/anthem/StatementVisitor.h +++ b/include/anthem/StatementVisitor.h @@ -65,9 +65,6 @@ struct StatementVisitor { const auto &bodyLiteral = *i; - if (bodyLiteral.sign != Clingo::AST::Sign::None) - throwErrorAtLocation(bodyLiteral.location, "only positive literals currently supported", context); - auto argument = bodyLiteral.data.accept(BodyBodyLiteralTranslateVisitor(), bodyLiteral, context); if (!argument)