bshell: add ast node definitions
This commit is contained in:
@@ -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,
|
||||
};
|
||||
Reference in New Issue
Block a user