Relaxing white space requirements.

This commit is contained in:
2016-06-02 23:41:40 +02:00
parent 8817a3f226
commit 50315f5fae
5 changed files with 239 additions and 2 deletions

View File

@@ -64,7 +64,8 @@ void Description::parseContent(utils::Parser &parser)
{
std::cout << "Parsing file content" << std::endl;
parser.expect<std::string>("(define");
parser.expect<std::string>("(");
parser.expect<std::string>("define");
parseSection(parser);
parser.expect<std::string>(")");
}

View File

@@ -97,7 +97,8 @@ const std::vector<std::unique_ptr<Action>> &Domain::actions() const
void Domain::parseSection(utils::Parser &parser)
{
parser.expect<std::string>("(:");
parser.expect<std::string>("(");
parser.expect<std::string>(":");
const auto sectionIdentifier = parser.parseIdentifier(isIdentifier);

View File

@@ -39,8 +39,12 @@ Predicate &Predicate::parseDeclaration(utils::Parser &parser, Context &context)
// Parse arguments
while (parser.currentCharacter() != ')')
{
Variable::parseTyped(parser, context, predicate->m_arguments);
parser.skipWhiteSpace();
}
parser.expect<std::string>(")");
const auto predicateArity = predicate->m_arguments.size();