removed NODE_EQUAL
This commit is contained in:
parent
cb021716ef
commit
9302e4710d
4 changed files with 2 additions and 8 deletions
5
lc.c
5
lc.c
|
|
@ -88,11 +88,6 @@ void print_ast(ast_node *node, int depth) {
|
||||||
print_ast(node->expr.binary.left, depth + 1);
|
print_ast(node->expr.binary.left, depth + 1);
|
||||||
print_ast(node->expr.binary.right, depth + 1);
|
print_ast(node->expr.binary.right, depth + 1);
|
||||||
break;
|
break;
|
||||||
case NODE_EQUAL:
|
|
||||||
printf("EqualOp (%s)\n", get_op_str(node->expr.binary.operator));
|
|
||||||
print_ast(node->expr.binary.left, depth + 1);
|
|
||||||
print_ast(node->expr.binary.right, depth + 1);
|
|
||||||
break;
|
|
||||||
case NODE_ARRAY_SUBSCRIPT:
|
case NODE_ARRAY_SUBSCRIPT:
|
||||||
printf("Array subscript\n");
|
printf("Array subscript\n");
|
||||||
print_ast(node->expr.subscript.expr, depth + 1);
|
print_ast(node->expr.subscript.expr, depth + 1);
|
||||||
|
|
|
||||||
2
parser.c
2
parser.c
|
|
@ -488,7 +488,7 @@ ast_node *parse_expression(parser *p)
|
||||||
}
|
}
|
||||||
advance(p);
|
advance(p);
|
||||||
ast_node *node = arena_alloc(p->allocator, sizeof(ast_node));
|
ast_node *node = arena_alloc(p->allocator, sizeof(ast_node));
|
||||||
node->type = NODE_EQUAL;
|
node->type = NODE_BINARY;
|
||||||
node->expr.binary.left = left;
|
node->expr.binary.left = left;
|
||||||
node->expr.binary.operator = op;
|
node->expr.binary.operator = op;
|
||||||
node->expr.binary.right = parse_expression(p);
|
node->expr.binary.right = parse_expression(p);
|
||||||
|
|
|
||||||
1
parser.h
1
parser.h
|
|
@ -71,7 +71,6 @@ typedef enum {
|
||||||
NODE_CAST,
|
NODE_CAST,
|
||||||
NODE_UNARY,
|
NODE_UNARY,
|
||||||
NODE_BINARY,
|
NODE_BINARY,
|
||||||
NODE_EQUAL,
|
|
||||||
NODE_RANGE,
|
NODE_RANGE,
|
||||||
NODE_ARRAY_SUBSCRIPT,
|
NODE_ARRAY_SUBSCRIPT,
|
||||||
NODE_ACCESS,
|
NODE_ACCESS,
|
||||||
|
|
|
||||||
2
test.c
2
test.c
|
|
@ -1,3 +1,3 @@
|
||||||
loop (0..1, list, 4..5, test, idk) |i, v, k, e, s| {
|
loop i != 0 {
|
||||||
printf("%d\n", i);
|
printf("%d\n", i);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue