54 lines
862 B
C
54 lines
862 B
C
|
|
#include <debug.h>
|
|
|
|
#include <color_factory/struct.h>
|
|
|
|
#include <stringtree/new.h>
|
|
#include <stringtree/prepend.h>
|
|
#include <stringtree/append.h>
|
|
|
|
#include <value/prettyprint.h>
|
|
|
|
#include "struct.h"
|
|
#include "prettyprint.h"
|
|
|
|
struct stringtree* variable_expression_prettyprint(
|
|
int *out_chosen_color,
|
|
struct expression* super,
|
|
struct color_factory* cfactory,
|
|
bool with_color)
|
|
{
|
|
ENTER;
|
|
|
|
struct variable_expression* const this = (void*) super;
|
|
|
|
struct stringtree* tree = new_stringtree();
|
|
|
|
stringtree_append_string(tree, this->name);
|
|
|
|
if (with_color)
|
|
{
|
|
stringtree_prepend_string(tree, cfactory->variable);
|
|
|
|
stringtree_append_string(tree, cfactory->reset);
|
|
|
|
if (out_chosen_color)
|
|
*out_chosen_color = -1;
|
|
}
|
|
|
|
EXIT;
|
|
return tree;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|