diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-01 17:51:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-01 20:05:06 -0700 |
commit | b9d23bcf53ee7b041b511a25a36291ae7166c73b (patch) | |
tree | 36b5fe477b442176f91ca549d6080029c756b2b9 /regex.c | |
parent | 0f050c4f3d57605ad0692e5abf2f61d0e75f408e (diff) | |
download | txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.tar.gz txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.tar.bz2 txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.zip |
Pass pretty flag to cobj print operation.
* hash.c (hash_print_op): Take third argument,
and call cobj_print_impl rather than cobj_print.
* lib.c (cobj_print_op): Take third argument. The object class is
* printed with obj_print_impl.
(obj_print_impl): Static function becomes extern. Passes its pretty
flag argument to cobj print virtual function.
* lib.h (cobj_ops): print takes third argument.
(cobj_print_op): Declaration updated.
(obj_print_impl): Declared.
* regex.c (regex_print): Takes third argument, and ignores it.
* stream.c (stream_print_op, stdio_stream_print, cat_stream_print):
Take third argument, and ignore it.
* stream.h (stream_print_op): Declaration updated.
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1307,7 +1307,7 @@ static void regex_mark(val obj) gc_mark(regex->source); } -static void regex_print(val obj, val stream); +static void regex_print(val obj, val stream, val pretty); static struct cobj_ops regex_obj_ops = cobj_ops_init(eq, regex_print, @@ -1836,10 +1836,11 @@ static void print_rec(val exp, val stream) } } -static void regex_print(val obj, val stream) +static void regex_print(val obj, val stream, val pretty) { regex_t *regex = coerce(regex_t *, cobj_handle(obj, regex_s)); + (void) pretty; put_string(lit("#/"), stream); print_rec(regex->source, stream); put_char(chr('/'), stream); |