use of mb.nabl2.constraints.nameresolution.CDeclProperty in project nabl by metaborg.
the class NameResolutionComponent method solve.
private Optional<SolveResult> solve(CDeclProperty c) {
final ITerm declTerm = unifier().findRecursive(c.getDeclaration());
if (!declTerm.isGround()) {
return Optional.empty();
}
final Occurrence decl = Occurrence.matcher().match(declTerm, unifier()).orElseThrow(() -> new TypeException("Expected an occurrence as first argument to " + c));
final SolveResult result = putProperty(decl, c.getKey(), c.getValue(), c.getMessageInfo()).map(cc -> SolveResult.constraints(cc)).orElseGet(() -> SolveResult.empty());
return Optional.of(result);
}
Aggregations