lambda-calculus/stringtree/print.c
2025-01-13 20:36:07 -06:00

48 lines
906 B
C

#include <assert.h>
#include <debug.h>
#include <string/print.h>
#include <wcostream/write.h>
#include "struct.h"
#include "print.h"
void stringtree_print(
struct stringtree* this,
struct wcostream* stream)
{
for (struct child* c = this->head; c; c = c->next)
{
switch (c->kind)
{
case ck_cstr:
{
wcostream_write(stream, c->cstr, wcslen(c->cstr));
break;
}
case ck_string:
{
string_write(c->string, stream);
break;
}
case ck_stringtree:
{
stringtree_print(c->stringtree, stream);
break;
}
default:
TODO;
break;
}
}
}