Permalink
Browse files

Add some better printing and fixing a problem with uninitialized ids

  • Loading branch information...
1 parent 1f065f0 commit 9169863d4d74d75e463d8ac679d773f9f52e2b5f @olabini committed Jul 20, 2009
@@ -322,6 +322,7 @@ public static boolean orgHandler(IRubyObject self, org.yecht.Node n, IRubyObject
IRubyObject k = (IRubyObject)n.mapRead(MapPart.Key, i);
IRubyObject v = (IRubyObject)n.mapRead(MapPart.Value, i);
if(null == k) {
+ System.err.println("working on: " + n);
System.err.println("k is nil!");
}
if(null == v) {
@@ -396,7 +397,7 @@ public Object handle(Parser p, org.yecht.Node n) {
IRubyObject obj = resolver.callMethod(runtime.getCurrentContext(), "node_import", _n);
// System.err.println(" node_import -> " + obj);
- if(!obj.isNil()) {
+ if(n.id == null || !obj.isNil()) {
n.id = obj;
// System.err.println(" -- LoadHandler, setting id, yay!");
}
@@ -18,7 +18,7 @@
public int idx;
public String toString() {
- return "{}";
+ return "{idx=" + idx + ", capa=" + capa + ", keys=" + java.util.Arrays.asList(keys) + ", values=" + java.util.Arrays.asList(values) + "}";
}
public Map copy() {
@@ -41,7 +41,7 @@ public Map copy() {
public int idx;
public String toString() {
- return "[]";
+ return "[idx=" + idx + ", capa=" + capa + ", items=" + java.util.Arrays.asList(items) + "]";
}
public Seq copy() {
@@ -290,6 +290,7 @@ private void yechtparse() {
// syck_hdlr_add_node
public Object addNode(Node n) {
+ // System.err.println("addNode(" + n + ")");
if(n.id == null) {
n.id = handler.handle(this, n);
}

0 comments on commit 9169863

Please sign in to comment.