lambda-calc-1/expression/error/prettyprint_errors.c
2025-01-20 13:40:51 -06:00

38 lines
693 B
C

#include <debug.h>
#include <stringtree/new.h>
#include <stringtree/append.h>
#include "../prettyprint_errors.h"
#include "struct.h"
#include "prettyprint_errors.h"
struct stringtree* error_expression_prettyprint_errors(
struct expression* super)
{
ENTER;
struct error_expression* const this = (void*) super;
struct stringtree* tree = NULL;
if (this->subexpression)
{
tree = expression_prettyprint_errors(
this->subexpression);
}
if (!tree)
{
tree = new_stringtree();
}
stringtree_append_cstr(tree, this->message);
stringtree_append_cstr(tree, L"\n");
EXIT;
return tree;
}