aboutsummaryrefslogtreecommitdiff
path: root/src/prc1/print.h
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-10-01 01:04:30 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2026-10-05 00:38:49 +0200
commit2b0d4ead061a39da9dbd705c18c9955549c4d405 (patch)
tree1412ac39adce3428b96caf67b1e7543f6c1246a5 /src/prc1/print.h
parent9140988be4e5bb028b7140aca1a67af1370c72a7 (diff)
downloadprc-2b0d4ead061a39da9dbd705c18c9955549c4d405.tar.gz
WIP symsym
Diffstat (limited to 'src/prc1/print.h')
-rw-r--r--src/prc1/print.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/prc1/print.h b/src/prc1/print.h
index 950e0bc..541c597 100644
--- a/src/prc1/print.h
+++ b/src/prc1/print.h
@@ -3,24 +3,29 @@
#include "cgen.h"
#include "lex.h"
+#include "prv.h"
#include <stddef.h>
-struct prientry
+struct prisym
{
- const struct tk *tk;
- const struct lit *lit;
- const struct stentry *entry;
+ enum {PRS_LIT, PRS_STR, PRS_PTR, PRS_NUM} type;
+ const struct sym *s;
+
+ union
+ {
+ const struct lit *lit;
+ } u;
};
struct print
{
- struct prientry *entries;
- size_t nentries;
- int println;
+ struct prisym *syms;
+ size_t nsyms;
+ int skipln;
};
-int print(const struct lex *l, struct prv *p,
- int (*fn)(const struct lex *, const struct prv *, const struct print *));
+int print(const struct lex *l, struct prv *p);
+int print_cgen(const struct print *pr, struct cgen *c, const char *f);
void print_free(struct print *p);
#endif