diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-07-03 16:09:10 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-07-03 16:09:10 -0400 |
commit | 119950ebde3c9f096d1866ba6448d6bd9b22d063 (patch) | |
tree | 35e6bb7a2507910ac784356baf25c2412b6959b6 /eval.c | |
parent | b25f392b221cea498ea7695f68828909734b51cd (diff) |
removed ability to evaluate a function before it is declared at compile time; that was causing too many problems
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1023,7 +1023,9 @@ static Status eval_ident(Evaluator *ev, Identifier ident, Value *v, Location whe v->type->kind = TYPE_STRUCT; v->type->struc = d->expr.typeval->struc; return true; + } else if (d->flags & DECL_FOUND_TYPE) { } else { + #if 0 Typer *tr = ev->typer; Block *prev_block = tr->block; /* make sure we're in the right block for typing the declaration */ @@ -1032,6 +1034,10 @@ static Status eval_ident(Evaluator *ev, Identifier ident, Value *v, Location whe tr->block = prev_block; if (!success) return false; assert(d->type.flags & TYPE_IS_RESOLVED); + #else + err_print(where, "Use of identifier at compile time before it is declared. This isn't allowed. Sorry."); + return false; + #endif } Value *ival = ident_val(ev, ident, where); if (!ival) return false; @@ -1691,6 +1697,9 @@ static Status eval_stmt(Evaluator *ev, Statement *stmt) { case STMT_BLOCK: if (!eval_block(ev, stmt->block)) return false; break; + case STMT_INCLUDE: + assert(0); + break; } return true; } |