pretty printing for expressions and types

This commit is contained in:
krangelov
2021-08-26 15:46:16 +02:00
parent 07bda06fb2
commit 275addfcbe
11 changed files with 572 additions and 11 deletions

View File

@@ -19,9 +19,9 @@ int textcmp(PgfText *t1, PgfText *t2)
PGF_INTERNAL
PgfText* textdup(PgfText *t1)
{
PgfText *t2 = (PgfText *) malloc(sizeof(PgfText) + t1->size + 1);
t2->size = t1->size;
memcpy(t2->text, t1->text, t1->size+1);
size_t size = sizeof(PgfText)+t1->size+1;
PgfText *t2 = (PgfText *) malloc(size);
memcpy(t2, t1, size);
return t2;
}