add if statements

This commit is contained in:
2025-06-03 13:24:12 +01:00
parent ef61c391a1
commit 18993a5d7e
16 changed files with 148 additions and 26 deletions

View File

@@ -1,12 +1,12 @@
#include "number.h"
#include "../../lexer/token.h"
#include "../parser.h"
#include <stdlib.h>
#include "../../memory.h"
#include <gmp.h>
ParsedValue *parse_number(Token *token) {
ParsedValue *parsedValue = malloc(sizeof(ParsedValue));
mpz_t *number = malloc(sizeof(mpz_t));
ParsedValue *parsedValue = checked_malloc(sizeof(ParsedValue));
mpz_t *number = checked_malloc(sizeof(mpz_t));
mpz_init_set_str(*number, token->value, 10);
parsedValue->type = AST_NUMBER;
parsedValue->data = number;