diff options
| author | gingerBill <bill@gingerbill.org> | 2018-02-24 19:03:29 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-02-24 19:03:29 +0000 |
| commit | 35ba5771a5dbe5fec3fea8804fb46fe843478830 (patch) | |
| tree | d46c33864d8a2b14a2bba7c860ce2cf875f2bc39 /src/checker.cpp | |
| parent | b2461f7192684f979301be9f174237e740ec28c6 (diff) | |
Replace `compile_assert` with `#assert`
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 1cc4c1ca9..3a11d4f94 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1,6 +1,8 @@ #include "entity.cpp" #include "types.cpp" +void check_expr(Checker *c, Operand *operand, AstNode *expression); + bool is_operand_value(Operand o) { switch (o.mode) { @@ -272,6 +274,7 @@ void destroy_scope(Scope *scope) { map_destroy(&scope->elements); array_free(&scope->shared); array_free(&scope->delayed_file_decls); + array_free(&scope->delayed_asserts); ptr_set_destroy(&scope->implicit); ptr_set_destroy(&scope->imported); ptr_set_destroy(&scope->exported); @@ -444,6 +447,7 @@ GB_COMPARE_PROC(entity_variable_pos_cmp) { return token_pos_cmp(x->token.pos, y->token.pos); } + void check_scope_usage(Checker *c, Scope *scope) { // TODO(bill): Use this? #if 0 @@ -2678,6 +2682,14 @@ bool collect_file_decls(Checker *c, Array<AstNode *> decls) { } } case_end; + + case_ast_node(ce, CallExpr, decl); + if (ce->proc->kind == AstNode_BasicDirective && + ce->proc->BasicDirective.name == "assert") { + Operand o = {}; + check_expr(c, &o, decl); + } + case_end; } } |