diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-05-09 10:01:10 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-05-09 10:01:10 +0100 |
| commit | 64b5afd82096f3e9dfde125a8846d606db7c85fb (patch) | |
| tree | 3771f57ca8afc6420ce11a219f0cb31108b0eb81 /src/check_decl.c | |
| parent | 7692061eef48765ac51b8a8f3024491381fdf182 (diff) | |
Fix issue #63 for block comments not terminating at an EOF
Diffstat (limited to 'src/check_decl.c')
| -rw-r--r-- | src/check_decl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/check_decl.c b/src/check_decl.c index 587877be7..3778197c6 100644 --- a/src/check_decl.c +++ b/src/check_decl.c @@ -44,6 +44,8 @@ Type *check_init_variable(Checker *c, Entity *e, Operand *operand, String contex e->type = t; } + e->parent_proc_decl = c->context.curr_proc_decl; + check_assignment(c, operand, e->type, context_name); if (operand->mode == Addressing_Invalid) { return NULL; @@ -122,6 +124,8 @@ void check_init_constant(Checker *c, Entity *e, Operand *operand) { return; } + e->parent_proc_decl = c->context.curr_proc_decl; + e->Constant.value = operand->value; } @@ -497,6 +501,8 @@ void check_entity_decl(Checker *c, Entity *e, DeclInfo *d, Type *named_type) { c->context.scope = d->scope; c->context.decl = d; + e->parent_proc_decl = c->context.curr_proc_decl; + switch (e->kind) { case Entity_Variable: check_var_decl(c, e, d->entities, d->entity_count, d->type_expr, d->init_expr); @@ -535,6 +541,7 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod c->context.scope = decl->scope; c->context.decl = decl; c->context.proc_name = proc_name; + c->context.curr_proc_decl = decl; GB_ASSERT(type->kind == Type_Proc); if (type->Proc.param_count > 0) { |