diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-08-15 21:41:29 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-08-15 21:41:29 +0300 |
| commit | bad9ab7479d66dfdb1c8e2d18c23fbcff9ec394b (patch) | |
| tree | d43dd3a26685c9adc8201dfe1a4035418175c1eb /src/ast.c | |
| parent | 5ffc39352ef0195697953e9318b8a17c79e7ae84 (diff) | |
| download | ek-bad9ab7479d66dfdb1c8e2d18c23fbcff9ec394b.tar.gz ek-bad9ab7479d66dfdb1c8e2d18c23fbcff9ec394b.zip | |
updates to syntax
Diffstat (limited to 'src/ast.c')
| -rw-r--r-- | src/ast.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -411,7 +411,7 @@ struct ast_node *gen_case(struct ast_node *cond, struct ast_node *body) n->_case.body = body; /* TODO: where should I check the fallthrough flag? In the * actualization stage, I guess */ - n->loc = cond->loc; + n->loc = body->loc; return n; } @@ -461,7 +461,8 @@ struct ast_node *gen_type(enum ast_type_kind kind, struct ast_node *id, case AST_TYPE_ARR: n->_type.arr.size = expr; - n->loc = expr->loc; + if (expr) + n->loc = expr->loc; break; case AST_TYPE_TYPEOF: @@ -682,7 +683,7 @@ struct ast_node *gen_lambda(struct ast_node *captures, n->_lambda.captures = captures; n->_lambda.sign = type; n->_lambda.body = body; - n->loc = type->loc; + n->loc = captures->loc; return n; } |
