lambda-calc-1/value/number/prettyprint.c

50 lines
794 B
C

#include <debug.h>
#include <globals/terminalcolors.h>
#include <stringtree/new.h>
#include <stringtree/append.h>
#include <stringtree/prepend.h>
#include <number/prettyprint.h>
#include "struct.h"
#include "inheritance.h"
#include "prettyprint.h"
struct stringtree* number_value_prettyprint(
int *out_chosen_color,
struct value* super,
bool with_color)
{
ENTER;
struct number_value* this = (void*) super;
struct stringtree* tree = number_prettyprint(this->value);
if (with_color)
{
stringtree_prepend_cstr(tree, terminalcolors.numeric);
stringtree_append_cstr(tree, terminalcolors.reset);
if (out_chosen_color)
*out_chosen_color = -1;
}
EXIT;
return tree;
}