patrick
/
plasp
Archived
1
0
Fork 0

Fixed constant parsing if no problem is specified.

This commit is contained in:
Patrick Lühne 2017-06-17 17:06:49 +02:00
parent 78b4636028
commit c84cafda18
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
1 changed files with 6 additions and 3 deletions

View File

@ -77,10 +77,13 @@ ast::ConstantPointer parseConstant(Context &context, ASTContext &astContext)
if (constant)
return std::move(constant.value());
constant = findConstant(constantName, astContext.problem.value()->objects);
if (astContext.problem)
{
constant = findConstant(constantName, astContext.problem.value()->objects);
if (constant)
return std::move(constant.value());
if (constant)
return std::move(constant.value());
}
throw ParserException(tokenizer.location(), "constant “" + constantName + "” used but never declared");
}