/** * Replace all references to the variable bound by this let expression, * that occur within the action expression, with the given expression * * * @param seq the expression * @return true if the variable was successfully inlined. (Returns false, for example, * if a variable reference occurs inside a try/catch, which inhibits inlining). */ public boolean replaceVariable(Expression seq) { boolean done = ExpressionTool.inlineVariableReferences(getAction(), this, seq); if (done && isIndexedVariable() && seq instanceof VariableReference) { Binding newBinding = ((VariableReference) seq).getBinding(); if (newBinding instanceof Assignation) { ((Assignation) newBinding).setIndexedVariable(); } } return done; }
/** * Replace all references to the variable bound by this let expression, * that occur within the action expression, with the given expression * * * @param seq the expression * @return true if the variable was successfully inlined. (Returns false, for example, * if a variable reference occurs inside a try/catch, which inhibits inlining). */ public boolean replaceVariable(Expression seq) { boolean done = ExpressionTool.inlineVariableReferences(getAction(), this, seq); if (done && isIndexedVariable() && seq instanceof VariableReference) { Binding newBinding = ((VariableReference) seq).getBinding(); if (newBinding instanceof Assignation) { ((Assignation) newBinding).setIndexedVariable(); } } return done; }