private void appendSplitReturn(final int splitState, final int lineNumber) { appendStatement(new SetSplitState(splitState, lineNumber)); if (getCurrentFunctionState().fn.isProgram()) { // If we're splitting the program, make sure every fragment passes back :return appendStatement(createReturnReturn()); } else { appendStatement(SplitReturn.INSTANCE); } }
@Override public boolean enterSplitReturn(final SplitReturn splitReturn) { if (method.isReachable()) { method.loadUndefined(lc.getCurrentFunction().getReturnType())._return(); } return false; }
@Override public boolean enterSplitReturn(final SplitReturn splitReturn) { doesNotContinueSequentially(); return false; }
/** * Callback for entering a SplitReturn * * @param splitReturn the node * @return true if traversal should continue and node children be traversed, false otherwise */ public boolean enterSplitReturn(final SplitReturn splitReturn) { return enterDefault(splitReturn); }
/** * Callback for leaving a SplitReturn * * @param splitReturn the node * @return processed node, which will replace the original one, or the original node */ public Node leaveSplitReturn(final SplitReturn splitReturn) { return leaveDefault(splitReturn); }