From 64feef1b9ea72adf7ba32998e9dca7d507607498 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Mon, 2 Jan 2023 22:31:49 -0800 Subject: a lot of stuff. --- src/token.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/token.c (limited to 'src/token.c') diff --git a/src/token.c b/src/token.c new file mode 100644 index 0000000..1cd0d91 --- /dev/null +++ b/src/token.c @@ -0,0 +1,15 @@ +#include "./include/token.h" +#include "./include/macros.h" + +#include + +token_t *init_token(int type, char *value, int row, int col) { + token_t *t = (token_t *)malloc(sizeof(token_t)); + if (t == NULL) + die("malloc on token struct"); + t->type = type; + t->value = value; + t->row = row; + t->col = col; + return t; +} -- cgit