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_expr.c | |
| parent | 7692061eef48765ac51b8a8f3024491381fdf182 (diff) | |
Fix issue #63 for block comments not terminating at an EOF
Diffstat (limited to 'src/check_expr.c')
| -rw-r--r-- | src/check_expr.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/check_expr.c b/src/check_expr.c index 414b15f06..089f706e4 100644 --- a/src/check_expr.c +++ b/src/check_expr.c @@ -1208,6 +1208,16 @@ Entity *check_ident(Checker *c, Operand *o, AstNode *n, Type *named_type, Type * } return NULL; } + if (e->parent_proc_decl != NULL && + e->parent_proc_decl != c->context.curr_proc_decl) { + if (e->kind == Entity_Variable) { + error(n->Ident, "Nested procedures do not capture its parent's variables: %.*s", LIT(name)); + return NULL; + } else if (e->kind == Entity_Label) { + error(n->Ident, "Nested procedures do not capture its parent's labels: %.*s", LIT(name)); + return NULL; + } + } bool is_overloaded = false; isize overload_count = 0; |