lang: ast: define ast_node_type for some fundamental expression components
This commit is contained in:
15
lang/ast/ident.c
Normal file
15
lang/ast/ident.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "ctx.h"
|
||||
#include "node.h"
|
||||
|
||||
static void print(struct ivy_ast_node *node)
|
||||
{
|
||||
struct ivy_ast_ident_node *ident = (struct ivy_ast_ident_node *)node;
|
||||
|
||||
printf("%s (%s)\n", ivy_ast_node_type_to_string(node->n_type), ident->n_content->t_str);
|
||||
}
|
||||
|
||||
struct ast_node_type ident_node_ops = {
|
||||
.n_print = print,
|
||||
.n_state_size = sizeof(struct parser_state),
|
||||
.n_node_size = sizeof(struct ivy_ast_ident_node),
|
||||
};
|
||||
Reference in New Issue
Block a user