p = p.getParentContext()) {
for (NameContext.VarInfo<String, ?> ni : p.vars()) {
String rewrittenName = ni.newName;
rewrittenNames.put(
rewrittenName,
new FormalParam(new Identifier(ni.declaredAt, rewrittenName)));
}
}
for (String fixedExtern : fixedExterns) {
rewrittenNames.put(
fixedExtern,
new FormalParam(new Identifier(FilePosition.UNKNOWN, fixedExtern)));
}
// If the input NameContext contains (foo => a, bar => b) then the program
// looks like { (function (a, b) { @rewrittenExpression; }; }
Block program = (Block) QuasiBuilder.substV(
"{ (function (@formals*) { @f; }); }",