diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-02 22:31:49 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-02 22:31:49 -0800 |
commit | 64feef1b9ea72adf7ba32998e9dca7d507607498 (patch) | |
tree | a409e61877bb51aa6fb2477175dabbf3dbccf298 /src/token.c |
a lot of stuff.
Diffstat (limited to 'src/token.c')
-rw-r--r-- | src/token.c | 15 |
1 files changed, 15 insertions, 0 deletions
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 <stdlib.h> + +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; +} |