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/files.c1
-rw-r--r--src/compile/headers.c18
-rw-r--r--src/compile/statements.c1
4 files changed, 0 insertions, 21 deletions
diff --git a/src/compile/expressions.c b/src/compile/expressions.c
index e9906253..cd244fec 100644
--- a/src/compile/expressions.c
+++ b/src/compile/expressions.c
@@ -233,7 +233,6 @@ Text_t compile(env_t *env, ast_t *ast) {
}
case Use: code_err(ast, "Compiling 'use' as expression!");
case Defer: code_err(ast, "Compiling 'defer' as expression!");
- case Extern: code_err(ast, "Externs are not supported as expressions");
case TableEntry: code_err(ast, "Table entries should not be compiled directly");
case Declare:
case Assign:
diff --git a/src/compile/files.c b/src/compile/files.c
index bd1e9cc3..f331a50a 100644
--- a/src/compile/files.c
+++ b/src/compile/files.c
@@ -150,7 +150,6 @@ Text_t compile_top_level_code(env_t *env, ast_t *ast) {
extended->id_suffix = env->id_suffix;
return compile_top_level_code(extended, extend->body);
}
- case Extern: return EMPTY_TEXT;
case Block: {
Text_t code = EMPTY_TEXT;
for (ast_list_t *stmt = Match(ast, Block)->statements; stmt; stmt = stmt->next) {
diff --git a/src/compile/headers.c b/src/compile/headers.c
index f6313cd6..1865905c 100644
--- a/src/compile/headers.c
+++ b/src/compile/headers.c
@@ -51,24 +51,6 @@ Text_t compile_statement_namespace_header(env_t *env, Path_t header_path, ast_t
block = def->namespace;
break;
}
- case Extern: {
- DeclareMatch(ext, ast, Extern);
- type_t *t = parse_type_ast(env, ext->type);
- Text_t decl;
- if (t->tag == ClosureType) {
- t = Match(t, ClosureType)->fn;
- DeclareMatch(fn, t, FunctionType);
- decl = Texts(compile_type(fn->ret), " ", ext->name, "(");
- for (arg_t *arg = fn->args; arg; arg = arg->next) {
- decl = Texts(decl, compile_type(arg->type));
- if (arg->next) decl = Texts(decl, ", ");
- }
- decl = Texts(decl, ")");
- } else {
- decl = compile_declaration(t, Text$from_str(ext->name));
- }
- return Texts("extern ", decl, ";\n");
- }
case Declare: {
DeclareMatch(decl, ast, Declare);
const char *decl_name = Match(decl->var, Var)->name;
diff --git a/src/compile/statements.c b/src/compile/statements.c
index db8f5b1f..a7705adc 100644
--- a/src/compile/statements.c
+++ b/src/compile/statements.c
@@ -166,7 +166,6 @@ static Text_t _compile_statement(env_t *env, ast_t *ast) {
ast_t *loop = WrapAST(ast, For, .vars = comp->vars, .iter = comp->iter, .body = body);
return compile_statement(env, loop);
}
- case Extern: return EMPTY_TEXT;
case InlineCCode: {
DeclareMatch(inline_code, ast, InlineCCode);
Text_t code = EMPTY_TEXT;