lisp-take-1/value/boolean/prettyprint.c

30 lines
543 B
C

#include <assert.h>
#include <debug.h>
#include <stringtree/new.h>
#include <stringtree/append.h>
#include "../struct.h"
#include "struct.h"
#include "prettyprint.h"
struct stringtree* boolean_value_prettyprint(
const struct value* super)
{
ENTER;
assert(super->kind == vk_boolean);
const struct boolean_value* this = &super->subclass.boolean;
struct stringtree* tree = new_stringtree();
stringtree_append_string_const(tree, this->value ? "true" : "false");
EXIT;
return tree;
}