summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-10-30 21:06:55 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-10-30 21:06:55 +0000
commit48b639e64efc4433ec03698b28ba80e5e1625a9a (patch)
treeaa9e1c279eb1652a5fbc1aa9e7457e954fa7da1b /src
parenta4194501fe2c60a19160c811c1a7818da5ce715e (diff)
fix the debug mode in the linearizer after the refactoring in libgu
Diffstat (limited to 'src')
-rw-r--r--src/runtime/c/pgf/linearizer.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/runtime/c/pgf/linearizer.c b/src/runtime/c/pgf/linearizer.c
index 9a57de5fc..0a1f0b1e6 100644
--- a/src/runtime/c/pgf/linearizer.c
+++ b/src/runtime/c/pgf/linearizer.c
@@ -105,39 +105,39 @@ typedef struct {
#ifdef PGF_LINEARIZER_DEBUG
void
-pgf_print_cnc_tree(PgfCncTree ctree, GuWriter* wtr, GuExn* err)
+pgf_print_cnc_tree(PgfCncTree ctree, GuOut* out, GuExn* err)
{
GuVariantInfo ti = gu_variant_open(ctree);
switch (ti.tag) {
case PGF_CNC_TREE_APP: {
PgfCncTreeApp* capp = ti.data;
- if (capp->n_args > 0) gu_putc('(', wtr, err);
- gu_printf(wtr, err, "F%d", capp->fun->funid);
+ if (capp->n_args > 0) gu_putc('(', out, err);
+ gu_printf(out, err, "F%d", capp->fun->funid);
for (size_t i = 0; i < capp->n_args; i++) {
- gu_putc(' ', wtr, err);
- pgf_print_cnc_tree(capp->args[i], wtr, err);
+ gu_putc(' ', out, err);
+ pgf_print_cnc_tree(capp->args[i], out, err);
}
- if (capp->n_args > 0) gu_putc(')', wtr, err);
+ if (capp->n_args > 0) gu_putc(')', out, err);
break;
}
case PGF_CNC_TREE_CHUNKS: {
PgfCncTreeChunks* chunks = ti.data;
- if (chunks->n_args > 0) gu_putc('(', wtr, err);
- gu_putc('?', wtr, err);
+ if (chunks->n_args > 0) gu_putc('(', out, err);
+ gu_putc('?', out, err);
for (size_t i = 0; i < chunks->n_args; i++) {
- gu_putc(' ', wtr, err);
- pgf_print_cnc_tree(chunks->args[i], wtr, err);
+ gu_putc(' ', out, err);
+ pgf_print_cnc_tree(chunks->args[i], out, err);
}
- if (chunks->n_args > 0) gu_putc(')', wtr, err);
+ if (chunks->n_args > 0) gu_putc(')', out, err);
break;
}
case PGF_CNC_TREE_LIT: {
PgfCncTreeLit* clit = ti.data;
- pgf_print_literal(clit->lit, wtr, err);
+ pgf_print_literal(clit->lit, out, err);
break;
}
case GU_VARIANT_NULL:
- gu_puts("null", wtr, err);
+ gu_puts("null", out, err);
break;
default:
gu_impossible();
@@ -426,13 +426,12 @@ pgf_cnc_tree_enum_next(GuEnum* self, void* to, GuPool* pool)
#ifdef PGF_LINEARIZER_DEBUG
GuPool* tmp_pool = gu_new_pool();
GuOut* out = gu_file_out(stderr, tmp_pool);
- GuWriter* wtr = gu_new_utf8_writer(out, tmp_pool);
GuExn* err = gu_exn(NULL, type, tmp_pool);
if (gu_variant_is_null(*toc))
- gu_puts("*nil*\n", wtr, err);
+ gu_puts("*nil*\n", out, err);
else {
- pgf_print_cnc_tree(*toc, wtr, err);
- gu_puts("\n", wtr, err);
+ pgf_print_cnc_tree(*toc, out, err);
+ gu_puts("\n", out, err);
}
gu_pool_free(tmp_pool);
#endif