1 28 29 package org.jruby.ast.visitor.rewriter.utils; 30 31 import java.util.Iterator ; 32 33 import org.jruby.ast.ArgumentNode; 34 import org.jruby.ast.Node; 35 import org.jruby.ast.visitor.rewriter.ReWriteVisitor; 36 37 public class MultipleAssignmentReWriteVisitor extends ReWriteVisitor { 38 39 public MultipleAssignmentReWriteVisitor(ReWriterContext config) { 40 super(config); 41 } 42 43 protected void printAssignmentOperator() { 44 } 45 46 protected boolean inMultipleAssignment() { 47 return true; 48 } 49 50 public void visitAndPrintWithSeparator(Iterator it) { 52 while (it.hasNext()) { 53 Node n = (Node) it.next(); 54 if(n instanceof ArgumentNode) { 55 config.getOutput().print(((ArgumentNode) n).getName()); 56 } else { 57 visitNode(n); 58 } 59 if (it.hasNext()) 60 print(", "); 61 } 62 } 63 } | Popular Tags |