aboutsummaryrefslogtreecommitdiff
path: root/src/compile
diff options
context:
space:
mode:
Diffstat (limited to 'src/compile')
-rw-r--r--src/compile/expressions.c1
-rw-r--r--src/compile/functions.c4
-rw-r--r--src/compile/optionals.c7
-rw-r--r--src/compile/optionals.h1
4 files changed, 0 insertions, 13 deletions
diff --git a/src/compile/expressions.c b/src/compile/expressions.c
index cd244fec..f4326b00 100644
--- a/src/compile/expressions.c
+++ b/src/compile/expressions.c
@@ -113,7 +113,6 @@ Text_t compile(env_t *env, ast_t *ast) {
}
case HeapAllocate:
case StackReference: return compile_typed_allocation(env, ast, get_type(env, ast));
- case Optional: return compile_optional(env, ast);
case NonOptional: return compile_non_optional(env, ast);
case Power:
case Multiply:
diff --git a/src/compile/functions.c b/src/compile/functions.c
index e2fa8a11..5f6f7e91 100644
--- a/src/compile/functions.c
+++ b/src/compile/functions.c
@@ -552,10 +552,6 @@ static void add_closed_vars(Table_t *closed_vars, env_t *enclosing_scope, env_t
add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, FieldAccess)->fielded);
break;
}
- case Optional: {
- add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, Optional)->value);
- break;
- }
case NonOptional: {
add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, NonOptional)->value);
break;
diff --git a/src/compile/optionals.c b/src/compile/optionals.c
index 86b4f771..d74f0f31 100644
--- a/src/compile/optionals.c
+++ b/src/compile/optionals.c
@@ -113,13 +113,6 @@ Text_t check_none(type_t *t, Text_t value) {
}
public
-Text_t compile_optional(env_t *env, ast_t *ast) {
- ast_t *value = Match(ast, Optional)->value;
- Text_t value_code = compile(env, value);
- return promote_to_optional(get_type(env, value), value_code);
-}
-
-public
Text_t compile_non_optional(env_t *env, ast_t *ast) {
ast_t *value = Match(ast, NonOptional)->value;
if (value->tag == Index && Match(value, Index)->index != NULL) return compile_indexing(env, value, true);
diff --git a/src/compile/optionals.h b/src/compile/optionals.h
index d30aaefb..28ee25b9 100644
--- a/src/compile/optionals.h
+++ b/src/compile/optionals.h
@@ -11,5 +11,4 @@ Text_t optional_into_nonnone(type_t *t, Text_t value);
Text_t promote_to_optional(type_t *t, Text_t code);
Text_t compile_none(type_t *t);
Text_t check_none(type_t *t, Text_t value);
-Text_t compile_optional(env_t *env, ast_t *ast);
Text_t compile_non_optional(env_t *env, ast_t *ast);