use of ast.Expression.With.On in project L42 by ElvisResearchGroup.
the class ToAst method parseOnPlus.
private On parseOnPlus(OnPlusContext on) {
List<Type> ts = new ArrayList<Type>();
for (TContext t : on.t()) {
ts.add(parseType(t));
}
Expression inner = on.eTop((on.Case() == null) ? 0 : 1).accept(this);
return new On(ts, inner);
}
use of ast.Expression.With.On in project L42 by ElvisResearchGroup.
the class DesugarW method oldWith_noUseKw.
private void oldWith_noUseKw(SquareWithCall s, X xX, List<VarDec> decs) {
List<With.On> ons = s.getWith().getOns();
List<With.On> onsPrime = new ArrayList<>();
for (With.On on : ons) {
onsPrime.add(on.withInner(withSquareAdd(s.getP(), xX, on.getInner())));
}
Optional<Expression> def = s.getWith().getDefaultE();
Optional<Expression> defPrime = Map.of(e -> withSquareAdd(s.getP(), xX, e), def);
With w = s.getWith().withOns(onsPrime).withDefaultE(defPrime);
decs.add(new VarDecE(w));
}