summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-10 20:48:39 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-10 20:48:39 -0800
commit12fc8a196dd7cfa4ef9413d7fde7545c78d1a017 (patch)
treebfdb1c0221e25814f3a547b8c9bb5e4678f904d4 /parser.c
parentb20f57e55eea53a570c1fb59961173035f00f8dc (diff)
downloadtxr-12fc8a196dd7cfa4ef9413d7fde7545c78d1a017.tar.gz
txr-12fc8a196dd7cfa4ef9413d7fde7545c78d1a017.tar.bz2
txr-12fc8a196dd7cfa4ef9413d7fde7545c78d1a017.zip
Handle interpreted functions in circle printing.
Interpreted functions print as #<interpreted fun: name args>, thus repeating some list structure in their notation. This means we must traverse them when populating the object hash during printing, and also when backpatching after parsing. Test case: evaluate and print (let ((s '(lambda (a b c) d))) (list s (eval s))) with *print-circle* enabled. * lib.c (populate_obj_hash): Handle FUN objects of functype FINTERP. * parser.c (circ_backpatch): Likewise.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index bf243711..75dbb89b 100644
--- a/parser.c
+++ b/parser.c
@@ -333,6 +333,13 @@ tail:
}
}
break;
+ case FUN:
+ if (obj->f.functype == FINTERP) {
+ val fun = obj->f.f.interp_fun;
+ circ_backpatch(p, &cs, car(fun));
+ obj = cadr(fun);
+ goto tail;
+ }
default:
break;
}