private void makeArguments(GoloFunction function, Set<String> refs) { Set<String> existing = new HashSet<>(function.getParameterNames()); for (String ref : refs) { if (!existing.contains(ref) && !ref.equals(function.getSyntheticSelfName())) { function.addSyntheticParameter(ref); } } }
@Override public void visitFunction(GoloFunction function) { if (function.isSynthetic()) { newContext(); declaredParameters(function.getParameterNames()); function.getBlock().internReferenceTable(); function.getBlock().accept(this); makeArguments(function, context().shouldBeArguments()); dropUnused(context().shouldBeRemoved()); dropContext(); } else { function.getBlock().accept(this); } }