diff options
author | Carlos Maniero <carlosmaniero@gmail.com> | 2023-04-26 01:57:42 -0300 |
---|---|---|
committer | Johnny Richard <johnny@johnnyrichard.com> | 2023-04-26 09:11:47 +0200 |
commit | cd77ac7997fa956c1d67ef91cde056e817aa16c7 (patch) | |
tree | f42ab962e225a90507a25d253d39d94095739cc9 /src/ast.c | |
parent | dddec15f6ac62311b4980f0de9e6893da00481ae (diff) |
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 <carlosmaniero@gmail.com>
Reviewed-by: Johnny Richard <johnny@johnnyrichar.com>
Diffstat (limited to 'src/ast.c')
-rw-r--r-- | src/ast.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |