lang: ast: implement parsing of break/continue loop-control statements
This commit is contained in:
21
lang/ast/loop-control.c
Normal file
21
lang/ast/loop-control.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "ctx.h"
|
||||
#include "node.h"
|
||||
|
||||
#include <blue/object/string.h>
|
||||
|
||||
static void to_string(struct ivy_ast_node *node, b_string *str)
|
||||
{
|
||||
b_string_append_cstrf(str, "%s", ivy_ast_node_type_to_string(node->n_type));
|
||||
}
|
||||
|
||||
struct ast_node_type loop_break_node_ops = {
|
||||
.n_to_string = to_string,
|
||||
.n_state_size = sizeof(struct parser_state),
|
||||
.n_node_size = sizeof(struct ivy_ast_loop_break_node),
|
||||
};
|
||||
|
||||
struct ast_node_type loop_repeat_node_ops = {
|
||||
.n_to_string = to_string,
|
||||
.n_state_size = sizeof(struct parser_state),
|
||||
.n_node_size = sizeof(struct ivy_ast_loop_repeat_node),
|
||||
};
|
||||
Reference in New Issue
Block a user