aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-18 17:25:28 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-18 17:25:28 +0100
commit04501c93fea4de6ecd085a80754d72f7d447972e (patch)
treeed02294f225a71547d9d0197314aad642ce11ccc /src/check_expr.cpp
parent4236519b84e2bea73b1b7756a20a2df24d3fb070 (diff)
Implement `assert` and `panic` in user side code
Removes 2 more built-in procedures!
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 52d2edd36..53cc615ad 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -4144,33 +4144,6 @@ bool check_builtin_procedure(Checker *c, Operand *operand, AstNode *call, i32 id
operand->type = t_untyped_bool;
break;
- case BuiltinProc_assert:
- // proc assert(cond: bool) -> bool
-
- if (!is_type_boolean(operand->type)) {
- gbString str = expr_to_string(ce->args[0]);
- error_node(call, "`%s` is not a boolean", str);
- gb_string_free(str);
- return false;
- }
-
- operand->mode = Addressing_Value;
- operand->type = t_untyped_bool;
- break;
-
- case BuiltinProc_panic:
- // proc panic(msg: string)
-
- if (!is_type_string(operand->type)) {
- gbString str = expr_to_string(ce->args[0]);
- error_node(call, "`%s` is not a string", str);
- gb_string_free(str);
- return false;
- }
-
- operand->mode = Addressing_NoValue;
- break;
-
case BuiltinProc_copy: {
// proc copy(x, y: []Type) -> int
Type *dest_type = NULL, *src_type = NULL;