use of st.gravel.support.compiler.ast.VariableScopeAnalyzerState in project gravel by gravel-st.
the class NonLocalTempAccessToHolderConverter method visitSequenceNode_.
@Override
public SequenceNode visitSequenceNode_(final SequenceNode _anObject) {
final SequenceNode[] _node;
_node = new SequenceNode[1];
_node[0] = SequenceNode.factory.temporaries_statements_(st.gravel.support.jvm.ArrayExtensions.collect_(_anObject.temporaries(), ((st.gravel.support.jvm.Block1<VariableDeclarationNode, VariableDeclarationNode>) (new st.gravel.support.jvm.Block1<VariableDeclarationNode, VariableDeclarationNode>() {
@Override
public VariableDeclarationNode value_(final VariableDeclarationNode _each) {
_temps.put(_each.name(), VariableScopeAnalyzerStateDefined.factory.basicNew());
return (VariableDeclarationNode) NonLocalTempAccessToHolderConverter.this.visit_(_each);
}
}))), st.gravel.support.jvm.ArrayExtensions.collect_(_anObject.statements(), ((st.gravel.support.jvm.Block1<Statement, Statement>) (new st.gravel.support.jvm.Block1<Statement, Statement>() {
@Override
public Statement value_(final Statement _each) {
return (Statement) NonLocalTempAccessToHolderConverter.this.visit_(_each);
}
}))));
for (final Map.Entry<String, VariableScopeAnalyzerState> _temp1 : _temps.entrySet()) {
String _varName = _temp1.getKey();
VariableScopeAnalyzerState _state = _temp1.getValue();
if (NonLocalTempAccessToHolderConverter.this.needsRewrite_(_state)) {
_node[0] = ((SequenceNode) VariableToHolderRewriter.factory.varName_(_varName).visit_(_node[0]));
}
}
return _node[0];
}
Aggregations