Made warnings more concise and consistent.
This commit is contained in:
parent
34d9c7a1c2
commit
f4c1d65365
|
@ -59,7 +59,7 @@ void checkRequirement(ast::Domain &domain, ast::Requirement requirement, Context
|
||||||
if (hasRequirement(domain, requirement))
|
if (hasRequirement(domain, requirement))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
context.warningCallback(context.tokenizer.location(), "requirement “" + std::string(toString(requirement)) + "” used but never declared");
|
context.warningCallback(context.tokenizer.location(), "requirement “" + std::string(toString(requirement)) + "” used but never declared, silently adding requirement");
|
||||||
|
|
||||||
domain.requirements.push_back(requirement);
|
domain.requirements.push_back(requirement);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ void checkRequirement(ast::Problem &problem, ast::Requirement requirement, Conte
|
||||||
if (hasRequirement(problem, requirement))
|
if (hasRequirement(problem, requirement))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
context.warningCallback(context.tokenizer.location(), "requirement “" + std::string(toString(requirement)) + "” used but never declared");
|
context.warningCallback(context.tokenizer.location(), "requirement “" + std::string(toString(requirement)) + "” used but never declared, silently adding requirement");
|
||||||
|
|
||||||
problem.requirements.push_back(requirement);
|
problem.requirements.push_back(requirement);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ void DescriptionParser::findSections()
|
||||||
|
|
||||||
if (tokenizer.testAndReturn<std::string>("in-package"))
|
if (tokenizer.testAndReturn<std::string>("in-package"))
|
||||||
{
|
{
|
||||||
m_context.warningCallback(tokenizer.location(), "ignoring “in-package” section, which is not part of the PDDL 3.1 specification");
|
m_context.warningCallback(tokenizer.location(), "“in-package” section is not part of the PDDL 3.1 specification, ignoring section");
|
||||||
|
|
||||||
skipSection(tokenizer);
|
skipSection(tokenizer);
|
||||||
tokenizer.skipWhiteSpace();
|
tokenizer.skipWhiteSpace();
|
||||||
|
|
|
@ -137,7 +137,7 @@ void DomainParser::findSections(ast::Domain &domain)
|
||||||
|
|
||||||
const auto sectionIdentifier = tokenizer.getIdentifier();
|
const auto sectionIdentifier = tokenizer.getIdentifier();
|
||||||
|
|
||||||
m_context.warningCallback(tokenizer.location(), "section type “" + sectionIdentifier + "” currently unsupported");
|
m_context.warningCallback(tokenizer.location(), "section type “" + sectionIdentifier + "” currently unsupported, ignoring section");
|
||||||
|
|
||||||
tokenizer.seek(sectionIdentifierPosition);
|
tokenizer.seek(sectionIdentifierPosition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ ast::PrimitiveTypePointer parsePrimitiveType(Context &context, ast::Domain &doma
|
||||||
// If the type has not been declared yet, add it but issue a warning
|
// If the type has not been declared yet, add it but issue a warning
|
||||||
if (matchingType == types.end())
|
if (matchingType == types.end())
|
||||||
{
|
{
|
||||||
context.warningCallback(tokenizer.location(), "primitive type “" + typeName + "” used without or before declaration");
|
context.warningCallback(tokenizer.location(), "primitive type “" + typeName + "” used without or before declaration, silently adding declaration");
|
||||||
|
|
||||||
types.emplace_back(std::make_unique<ast::PrimitiveTypeDeclaration>(std::move(typeName)));
|
types.emplace_back(std::make_unique<ast::PrimitiveTypeDeclaration>(std::move(typeName)));
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ void ProblemParser::findSections(ast::Problem &problem)
|
||||||
|
|
||||||
const auto sectionIdentifier = tokenizer.getIdentifier();
|
const auto sectionIdentifier = tokenizer.getIdentifier();
|
||||||
|
|
||||||
m_context.warningCallback(tokenizer.location(), "section type “" + sectionIdentifier + "” currently unsupported");
|
m_context.warningCallback(tokenizer.location(), "section type “" + sectionIdentifier + "” currently unsupported, ignoring section");
|
||||||
|
|
||||||
tokenizer.seek(sectionIdentifierPosition);
|
tokenizer.seek(sectionIdentifierPosition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ std::experimental::optional<ast::Requirement> parseRequirement(Context &context)
|
||||||
return matchingRequirement->second;
|
return matchingRequirement->second;
|
||||||
|
|
||||||
if (requirementName == "goal-utilities" || requirementName == "domain-axioms")
|
if (requirementName == "goal-utilities" || requirementName == "domain-axioms")
|
||||||
context.warningCallback(tokenizer.location(), "ignoring requirement “" + requirementName + "”, which is not part of the PDDL 3.1 specification");
|
context.warningCallback(tokenizer.location(), "“" + requirementName + "” requirement is not part of the PDDL 3.1 specification, ignoring requirement");
|
||||||
|
|
||||||
return std::experimental::nullopt;
|
return std::experimental::nullopt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ ast::UnsupportedPointer parseUnsupported(Context &context)
|
||||||
|
|
||||||
auto expressionType = tokenizer.getIdentifier();
|
auto expressionType = tokenizer.getIdentifier();
|
||||||
|
|
||||||
context.warningCallback(tokenizer.location(), "expression type “" + expressionType + "” currently unsupported in this context");
|
context.warningCallback(tokenizer.location(), "expression type “" + expressionType + "” currently unsupported in this context, substituting it with placeholder");
|
||||||
|
|
||||||
skipSection(tokenizer);
|
skipSection(tokenizer);
|
||||||
|
|
||||||
|
|
Reference in New Issue