From cd77ac7997fa956c1d67ef91cde056e817aa16c7 Mon Sep 17 00:00:00 2001 From: Carlos Maniero Date: Wed, 26 Apr 2023 01:57:42 -0300 Subject: ast: Include a Binary Operation kind enum The AST was using a string view to distinguish the operation kind. An enum was created for this purpose simplifying code generation. Signed-off-by: Carlos Maniero Reviewed-by: Johnny Richard --- src/ast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index 10bb79d..d8f406e 100644 --- a/src/ast.c +++ b/src/ast.c @@ -130,11 +130,11 @@ ast_literal_integer_create(ast_node_t *node, uint32_t number) } void -ast_node_init_binary_operation(ast_node_t *node, string_view_t op, ast_node_t *left, ast_node_t *right) +ast_node_init_binary_operation(ast_node_t *node, ast_binary_operation_kind_t kind, ast_node_t *left, ast_node_t *right) { node->accept_visitor = &ast_node_binary_operation_visitor; node->kind = AST_BINARY_OPERATION; - node->data = (ast_node_data_t){ .binary_operation = { .op = op, .left = left, .right = right } }; + node->data = (ast_node_data_t){ .binary_operation = { .kind = kind, .left = left, .right = right } }; } void -- cgit v1.2.3