bshell: add ast node definitions

This commit is contained in:
2026-05-09 18:59:13 +01:00
parent 8b0295faf2
commit 090f6a0002
11 changed files with 458 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#include "../parse/token.h"
#include "ast.h"
static void to_string(const struct ast_node *node, fx_bstr *out)
{
struct int_ast_node *i = (struct int_ast_node *)node;
fx_bstr_write_fmt(out, NULL, "%lld", i->n_value->tok_int);
}
struct ast_node_definition int_ast_node = {
.def_id = AST_INT,
.def_node_size = sizeof(struct int_ast_node),
.def_to_string = to_string,
};