|
From: Christopher W. <caw...@us...> - 2006-04-05 02:09:46
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1222/src/org/rubypeople/rdt/internal/core Modified Files: RubyScriptStructureBuilder.java Log Message: clean up output statements, show only when DEBUG set to true Index: RubyScriptStructureBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** RubyScriptStructureBuilder.java 4 Apr 2006 23:10:47 -0000 1.19 --- RubyScriptStructureBuilder.java 5 Apr 2006 02:09:41 -0000 1.20 *************** *** 141,157 **** private InfoStack infoStack = new InfoStack(); - private HandleStack modelStack = new HandleStack(); - private RubyScriptElementInfo scriptInfo; - private IRubyScript script; - private Visibility currentVisibility = Visibility.PUBLIC; - private Map newElements; - private RubyElementInfo importContainerInfo; - private boolean DEBUG = false; --- 141,150 ---- *************** *** 766,786 **** */ private String[] getArgs(Node argsNode) { - System.out.println("Got argument node: " + argsNode.toString()); ArgsNode args = (ArgsNode) argsNode; boolean hasRest = false; if (args.getRestArg() != -1) ! hasRest = true; ! boolean hasBlock = false; if (args.getBlockArgNode() != null) ! hasBlock = true; ! int optArgCount = 0; if (args.getOptArgs() != null) ! optArgCount = args.getOptArgs().size(); List arguments = getArguments(args.getArgs()); if (optArgCount > 0) { arguments.addAll(getArguments(args.getOptArgs())); ! } if (hasRest) arguments.add("*rest"); --- 759,778 ---- */ private String[] getArgs(Node argsNode) { ArgsNode args = (ArgsNode) argsNode; boolean hasRest = false; if (args.getRestArg() != -1) ! hasRest = true; ! boolean hasBlock = false; if (args.getBlockArgNode() != null) ! hasBlock = true; ! int optArgCount = 0; if (args.getOptArgs() != null) ! optArgCount = args.getOptArgs().size(); List arguments = getArguments(args.getArgs()); if (optArgCount > 0) { arguments.addAll(getArguments(args.getOptArgs())); ! } if (hasRest) arguments.add("*rest"); *************** *** 803,807 **** Object node = iter.next(); if (node instanceof ArgumentNode) { ! arguments.add(((ArgumentNode)node).getName()); } else if (node instanceof LocalAsgnNode) { LocalAsgnNode local = (LocalAsgnNode) node; --- 795,799 ---- Object node = iter.next(); if (node instanceof ArgumentNode) { ! arguments.add(((ArgumentNode) node).getName()); } else if (node instanceof LocalAsgnNode) { LocalAsgnNode local = (LocalAsgnNode) node; *************** *** 810,816 **** argString += stringRepresentation(local.getValueNode()); arguments.add(argString); ! } ! else { ! System.err.println("Reached argument node type we can't handle"); } } --- 802,809 ---- argString += stringRepresentation(local.getValueNode()); arguments.add(argString); ! } else { ! if (DEBUG) ! System.err ! .println("Reached argument node type we can't handle"); } } *************** *** 819,831 **** private String stringRepresentation(Node node) { ! if (node instanceof HashNode) return "{}"; ! if (node instanceof ZArrayNode) return "[]"; ! if (node instanceof FixnumNode) return "" + ((FixnumNode)node).getValue(); ! if (node instanceof DStrNode) return stringRepresentation((DStrNode) node); ! if (node instanceof StrNode) return ((StrNode) node).getValue(); ! System.err.println("Reached node type we don't know how to represent: " + node.getClass().getName()); return node.toString(); } ! private String stringRepresentation(DStrNode node) { List children = node.childNodes(); --- 812,830 ---- private String stringRepresentation(Node node) { ! if (node instanceof HashNode) ! return "{}"; ! if (node instanceof ZArrayNode) ! return "[]"; ! if (node instanceof FixnumNode) ! return "" + ((FixnumNode) node).getValue(); ! if (node instanceof DStrNode) ! return stringRepresentation((DStrNode) node); ! if (node instanceof StrNode) ! return ((StrNode) node).getValue(); ! if (DEBUG) System.err.println("Reached node type we don't know how to represent: " ! + node.getClass().getName()); return node.toString(); } ! private String stringRepresentation(DStrNode node) { List children = node.childNodes(); *************** *** 1699,1704 **** currentVisibility = Visibility.PROTECTED; } - // TODO Set the method visibility for any arguments to the above - // methods! return null; } --- 1698,1701 ---- *************** *** 1780,1785 **** */ private Instruction handleNode(Node visited) { ! // TODO Uncomment for logging? ! // if (DEBUG) System.out.println(visited.toString() + ", position -> " + visited.getPosition()); --- 1777,1782 ---- */ private Instruction handleNode(Node visited) { ! // Uncomment for logging ! if (DEBUG) System.out.println(visited.toString() + ", position -> " + visited.getPosition()); |