refactor: xmake in use, allocator sintaxis

This commit is contained in:
2026-06-10 16:03:21 -06:00
parent 21853362a4
commit 9a2e084143
9 changed files with 444 additions and 578 deletions

View File

@@ -1,9 +1,9 @@
#ifndef LEXER_H
#define LEXER_H
#include "arraylist.h"
#include <stddef.h>
#include "lae_arraylist.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
// For identifing
@@ -66,8 +66,8 @@ typedef struct {
} LexerI64Result;
// Lexer funtions as well as few functionality
TokenizeResult tokenize(const char* input);
TokenResult tokenize_number(const char* input, size_t *offset);
TokenizeResult tokenize(const char *input);
TokenResult tokenize_number(const char *input, size_t *offset);
LexerI64Result string_to_integer(const char buf[]);
bool isoperator(int c);
Operator char_to_operator(int c);

View File

@@ -1,9 +1,9 @@
#ifndef PARSER_H
#define PARSER_H
#include "lae_arena.h"
#include "lae_arraylist.h"
#include "lexer.h"
#include "arena.h"
#include "arraylist.h"
#include <stdbool.h>
#include <stdint.h>
@@ -21,11 +21,11 @@ typedef struct Node {
Operator op;
struct Node *left;
struct Node *right;
}binary;
} binary;
struct {
Operator op;
struct Node *to;
}unary;
} unary;
Operator par;
};
} Node;
@@ -51,7 +51,7 @@ typedef struct {
};
} ParserResult;
typedef struct {
typedef struct {
bool is_valid;
union {
ParserErr err;
@@ -76,7 +76,11 @@ typedef struct {
} ParserU8Result;
TreeResult nud(ArraySlice *slice, Arena *arena, Token token); // Null denotation
TreeResult led(ArraySlice *slice, Arena *arena, Node *left, Token token); // Left denotation
TreeResult
led(ArraySlice *slice,
Arena *arena,
Node *left,
Token token); // Left denotation
ParserU8Result prefix_rbp(Token token);
ParserU8Result postfix_lbp(Token token);