aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-03-27 20:32:36 +0100
committerGinger Bill <bill@gingerbill.org>2017-03-27 20:32:36 +0100
commita75ccb6fbc529d2fee00f9b456ca7c0c830548ee (patch)
treecbe963045fb415f9470c0a84fbdbbe6e75f350ff /src/check_stmt.c
parent188b290dd50664aa8a89955ac2ab7dbebf7a653d (diff)
v0.1.3v0.1.3
Diffstat (limited to 'src/check_stmt.c')
-rw-r--r--src/check_stmt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/check_stmt.c b/src/check_stmt.c
index 2eabaf798..6aec1beee 100644
--- a/src/check_stmt.c
+++ b/src/check_stmt.c
@@ -689,8 +689,8 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
case_ast_node(rs, RangeStmt, node);
u32 new_flags = mod_flags | Stmt_BreakAllowed | Stmt_ContinueAllowed;
- check_open_scope(c, node);
+ check_open_scope(c, node);
check_label(c, rs->label);
Type *val = NULL;
@@ -885,6 +885,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
mod_flags |= Stmt_BreakAllowed;
check_open_scope(c, node);
+ check_label(c, ms->label); // TODO(bill): What should the label's "scope" be?
if (ms->init != NULL) {
check_stmt(c, ms->init, 0);
@@ -897,8 +898,8 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
x.type = t_bool;
x.value = exact_value_bool(true);
- Token token = {0};
- token.pos = ast_node_token(ms->body).pos;
+ Token token = {0};
+ token.pos = ast_node_token(ms->body).pos;
token.string = str_lit("true");
x.expr = ast_ident(c->curr_ast_file, token);
}
@@ -1025,6 +1026,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
mod_flags |= Stmt_BreakAllowed;
check_open_scope(c, node);
+ check_label(c, ms->label); // TODO(bill): What should the label's "scope" be?
MatchTypeKind match_type_kind = MatchType_Invalid;
@@ -1051,8 +1053,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
match_type_kind = check_valid_type_match_type(x.type);
if (check_valid_type_match_type(x.type) == MatchType_Invalid) {
gbString str = type_to_string(x.type);
- error_node(x.expr,
- "Invalid type for this type match expression, got `%s`", str);
+ error_node(x.expr, "Invalid type for this type match expression, got `%s`", str);
gb_string_free(str);
break;
}
@@ -1387,7 +1388,9 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
case_ast_node(vd, ValueDecl, node);
GB_ASSERT(!c->context.scope->is_file);
- if (vd->is_var) {
+ if (!vd->is_var) {
+ // NOTE(bill): Handled elsewhere
+ } else {
Entity **entities = gb_alloc_array(c->allocator, Entity *, vd->names.count);
isize entity_count = 0;
@@ -1497,9 +1500,6 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
}
}
}
-
- } else {
- // NOTE(bill): Handled elsewhere
}
case_end;
}