15 lines
395 B
C
15 lines
395 B
C
#include "../parse/token.h"
|
|
#include "ast.h"
|
|
|
|
static void to_string(const struct ast_node *node, fx_bstr *out)
|
|
{
|
|
const struct word_ast_node *word = (const struct word_ast_node *)node;
|
|
fx_bstr_write_fmt(out, NULL, "%s", word->n_value->tok_str);
|
|
}
|
|
|
|
struct ast_node_definition word_ast_node = {
|
|
.def_id = AST_WORD,
|
|
.def_node_size = sizeof(struct word_ast_node),
|
|
.def_to_string = to_string,
|
|
};
|