To-dos and formatting.

This commit is contained in:
Patrick Lühne 2016-06-08 01:19:49 +02:00
parent 8db4b5a53e
commit 069ad4ca99
6 changed files with 4 additions and 17 deletions

View File

@ -28,8 +28,6 @@ class Constant: public Expression
static Constant *parseAndFind(Context &context, const ExpressionContext &expressionContext);
// TODO: method for lazy creation if not existing
public:
void accept(ExpressionVisitor &expressionVisitor) const override;

View File

@ -184,7 +184,7 @@ void Domain::parseRequirementSection()
m_context.parser.skipWhiteSpace();
}
// TODO: Do this check only once the problem is parsed
// TODO: do this check only once the problem is parsed
// If no requirements are specified, assume STRIPS
if (m_requirements.empty())
m_requirements.emplace_back(Requirement::Type::STRIPS);
@ -310,14 +310,6 @@ void Domain::parseActionSection()
void Domain::checkConsistency()
{
// Verify that all used predicates have been declared
std::for_each(m_predicateDeclarations.cbegin(), m_predicateDeclarations.cend(),
[&](const auto &predicate)
{
if (!predicate->isDeclared())
throw ConsistencyException("Predicate \"" + predicate->name() + "\" used but never declared");
});
// Verify that constants are unique
// Verify that all primitive types are unique
// Check for case-sensitivity issues

View File

@ -159,7 +159,7 @@ void Problem::parseRequirementSection()
m_context.parser.skipWhiteSpace();
}
// TODO: Do this check only once the domain is parsed
// TODO: do this check only once the domain is parsed
// If no requirements are specified, assume STRIPS
if (m_requirements.empty())
m_requirements.emplace_back(Requirement::Type::STRIPS);

View File

@ -45,8 +45,6 @@ ConstantPointer Constant::parseDeclaration(Context &context)
// Flag constant for potentially upcoming type declaration
constant->setDirty();
// TODO: Store constant in hash map
return constant;
}
@ -141,12 +139,12 @@ Constant *Constant::parseAndFind(Context &context, const ExpressionContext &expr
Constant *Constant::parseAndFind(const std::string &constantName, const Constants &constants)
{
// TODO: use hash map
const auto match = std::find_if(constants.cbegin(), constants.cend(),
[&](const auto &constant)
{
return constant->name() == constantName;
});
const auto constantExists = (match != constants.cend());
if (!constantExists)

View File

@ -46,7 +46,6 @@ void PrimitiveType::parseDeclaration(Context &context, Domain &domain)
const auto typeName = context.parser.parseIdentifier(isIdentifier);
// TODO: use hash map
const auto match = std::find_if(types.cbegin(), types.cend(),
[&](const auto &primitiveType)
{
@ -113,7 +112,6 @@ PrimitiveType *PrimitiveType::parseAndFind(Context &context, Domain &domain)
BOOST_ASSERT(!typeName.empty());
// TODO: use hash map
const auto match = std::find_if(types.cbegin(), types.cend(),
[&](const auto &primitiveType)
{

View File

@ -21,6 +21,7 @@ TEST(UtilsTests, ParseSimple)
ASSERT_THROW(p.expect<std::string>("expected"), plasp::utils::ParserException);
// TODO: test case-insensitive input
// TODO: test probing
}
////////////////////////////////////////////////////////////////////////////////////////////////////