Fixed constant parsing if no problem is specified.
This commit is contained in:
parent
78b4636028
commit
c84cafda18
@ -77,10 +77,13 @@ ast::ConstantPointer parseConstant(Context &context, ASTContext &astContext)
|
|||||||
if (constant)
|
if (constant)
|
||||||
return std::move(constant.value());
|
return std::move(constant.value());
|
||||||
|
|
||||||
constant = findConstant(constantName, astContext.problem.value()->objects);
|
if (astContext.problem)
|
||||||
|
{
|
||||||
|
constant = findConstant(constantName, astContext.problem.value()->objects);
|
||||||
|
|
||||||
if (constant)
|
if (constant)
|
||||||
return std::move(constant.value());
|
return std::move(constant.value());
|
||||||
|
}
|
||||||
|
|
||||||
throw ParserException(tokenizer.location(), "constant “" + constantName + "” used but never declared");
|
throw ParserException(tokenizer.location(), "constant “" + constantName + "” used but never declared");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user