From 9fba2862b3ba48a97a4497d48e9d98353f3f2221 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 8 Nov 2019 02:40:10 +0100 Subject: [PATCH] :shirt: Clean headers (use gwion_env.h) --- include/{ => env}/context.h | 0 include/{ => env}/env.h | 0 include/{ => env}/func.h | 0 include/{ => env}/nspc.h | 0 include/{ => env}/oo.h | 0 include/{ => env}/type.h | 0 include/{ => env}/value.h | 0 include/gwion_env.h | 12 ++++++++++++ include/parse.h | 23 +++++++++++++++++++++++ src/arg.c | 4 +--- src/compile.c | 7 +------ src/emit/emit.c | 9 +-------- src/emit/emitter.c | 6 +----- src/emit/escape.c | 3 +-- src/emit/memoize.c | 6 +----- src/gwion.c | 8 +------- src/gwiondata.c | 3 +-- src/import/cdef.c | 7 +------ src/import/checker.c | 7 +------ src/import/enum.c | 7 +------ src/import/fdef.c | 9 ++------- src/import/internals.c | 5 +---- src/import/item.c | 5 +---- src/import/oper.c | 7 +------ src/import/special.c | 7 +------ src/import/tdef.c | 7 +------ src/import/type.c | 7 +------ src/import/udef.c | 7 +------ src/lib/array.c | 5 +---- src/lib/complex.c | 5 +---- src/lib/engine.c | 7 +------ src/lib/event.c | 5 +---- src/lib/func.c | 7 +------ src/lib/gack.c | 6 +----- src/lib/instr.c | 14 +++----------- src/lib/modules.c | 6 +----- src/lib/object.c | 7 +------ src/lib/opfunc.c | 5 +---- src/lib/prim.c | 5 +---- src/lib/ptr.c | 6 +----- src/lib/shred.c | 8 ++------ src/lib/string.c | 6 +----- src/lib/tuple.c | 8 +------- src/lib/ugen.c | 8 ++------ src/lib/vararg.c | 8 +------- src/lib/vec.c | 5 +---- src/main.c | 3 +-- src/oo/context.c | 7 +------ src/oo/env.c | 10 +--------- src/oo/env_utils.c | 8 +------- src/oo/nspc.c | 8 +------- src/oo/type.c | 7 +------ src/oo/value.c | 6 +----- src/parse/check.c | 9 +-------- src/parse/did_you_mean.c | 9 +-------- src/parse/func.c | 14 +------------- src/parse/operator.c | 7 +------ src/parse/scan0.c | 9 +-------- src/parse/scan1.c | 8 +------- src/parse/scan2.c | 9 +-------- src/parse/scanx.c | 6 +----- src/parse/stage.c | 5 +---- src/parse/template.c | 8 +------- src/parse/traverse.c | 3 +-- src/parse/type_decl.c | 11 +---------- src/parse/type_utils.c | 5 +---- src/pass.c | 3 +-- src/plug.c | 6 +----- src/vm/driver.c | 7 +------ src/vm/shreduler.c | 2 +- src/vm/vm.c | 11 +---------- src/vm/vm_code.c | 8 +------- src/vm/vm_name.c | 3 --- src/vm/vm_shred.c | 5 +---- 74 files changed, 104 insertions(+), 370 deletions(-) rename include/{ => env}/context.h (100%) rename include/{ => env}/env.h (100%) rename include/{ => env}/func.h (100%) rename include/{ => env}/nspc.h (100%) rename include/{ => env}/oo.h (100%) rename include/{ => env}/type.h (100%) rename include/{ => env}/value.h (100%) create mode 100644 include/gwion_env.h diff --git a/include/context.h b/include/env/context.h similarity index 100% rename from include/context.h rename to include/env/context.h diff --git a/include/env.h b/include/env/env.h similarity index 100% rename from include/env.h rename to include/env/env.h diff --git a/include/func.h b/include/env/func.h similarity index 100% rename from include/func.h rename to include/env/func.h diff --git a/include/nspc.h b/include/env/nspc.h similarity index 100% rename from include/nspc.h rename to include/env/nspc.h diff --git a/include/oo.h b/include/env/oo.h similarity index 100% rename from include/oo.h rename to include/env/oo.h diff --git a/include/type.h b/include/env/type.h similarity index 100% rename from include/type.h rename to include/env/type.h diff --git a/include/value.h b/include/env/value.h similarity index 100% rename from include/value.h rename to include/env/value.h diff --git a/include/gwion_env.h b/include/gwion_env.h new file mode 100644 index 00000000..c6b95277 --- /dev/null +++ b/include/gwion_env.h @@ -0,0 +1,12 @@ +#ifndef __GWION_ENV +#define __GWION_ENV + +#include "env/oo.h" +#include "env/nspc.h" +#include "env/env.h" + +#include "env/value.h" +#include "env/type.h" +#include "env/func.h" +#include "env/context.h" +#endif diff --git a/include/parse.h b/include/parse.h index a37ff5c8..4cbf523b 100644 --- a/include/parse.h +++ b/include/parse.h @@ -27,6 +27,18 @@ else if(GET_FLAG(a, protect)) \ typedef m_bool (*_exp_func)(const void*, const void*); static inline m_bool dummy_func(const void*a NUSED, const void*b NUSED) { return 1; } + +#define DECL_PRIM_FUNC(prefix) \ +static const _exp_func prim_func[] = { \ + (_exp_func)prefix##__primary_id, (_exp_func)prefix##__primary_num, \ + (_exp_func)prefix##__primary_float, (_exp_func)prefix##__primary_str, \ + (_exp_func)prefix##__primary_array, (_exp_func)prefix##__primary_hack, \ + (_exp_func)prefix##__primary_complex, (_exp_func)prefix##__primary_polar, \ + (_exp_func)prefix##__primary_vec, (_exp_func)prefix##__primary_tuple, \ + (_exp_func)prefix##__primary_unpack, (_exp_func)prefix##__primary_char, \ + (_exp_func)prefix##__primary_nil \ +} + #define DECL_EXP_FUNC(prefix) \ static const _exp_func exp_func[] = { \ (_exp_func)prefix##_exp_decl, (_exp_func)prefix##_exp_binary, (_exp_func)prefix##_exp_unary, \ @@ -35,6 +47,17 @@ static const _exp_func exp_func[] = { (_exp_func)prefix##_exp_dot, (_exp_func)prefix##_exp_lambda, (_exp_func)prefix##_exp_typeof \ }; +#define DECL_STMT_FUNC(prefix) \ +static const _exp_func stmt_func[] = { \ + (_exp_func)prefix##__stmt_exp, (_exp_func)prefix##__stmt_while, \ + (_exp_func)prefix##__stmt_until, (_exp_func)prefix##__stmt_for, \ + (_exp_func)prefix##__stmt_auto, (_exp_func)prefix##__stmt_loop, \ + (_exp_func)prefix##__stmt_if, (_exp_func)prefix##__stmt_code, \ + (_exp_func)prefix##__stmt_break, (_exp_func)prefix##__stmt_continue, \ + (_exp_func)prefix##__stmt_return, (_exp_func)prefix##__stmt_match, \ + (_exp_func)prefix##__stmt_jump, \ +}; + #define DECL_SECTION_FUNC(prefix) \ static const _exp_func section_func[] = { \ (_exp_func)prefix##_stmt_list, (_exp_func)prefix##_func_def, (_exp_func)prefix##_class_def, \ diff --git a/src/arg.c b/src/arg.c index 2c6e48ed..d22587e6 100644 --- a/src/arg.c +++ b/src/arg.c @@ -1,9 +1,7 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" +#include "gwion_env.h" #include "soundinfo.h" -#include "oo.h" -#include "env.h" #include "vm.h" #include "gwion.h" #include "arg.h" diff --git a/src/compile.c b/src/compile.c index 991761f1..c1947b90 100644 --- a/src/compile.c +++ b/src/compile.c @@ -1,13 +1,8 @@ -#include -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "instr.h" -#include "type.h" #include "emit.h" #include "compile.h" #include "gwion.h" diff --git a/src/emit/emit.c b/src/emit/emit.c index f9319a8d..ca90a3df 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1,19 +1,12 @@ -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" -#include "nspc.h" -#include "value.h" #include "instr.h" #include "emit.h" #include "object.h" #include "array.h" -#include "func.h" #include "traverse.h" #include "template.h" #include "escape.h" diff --git a/src/emit/emitter.c b/src/emit/emitter.c index d5c19dd8..2527bf4c 100644 --- a/src/emit/emitter.c +++ b/src/emit/emitter.c @@ -1,12 +1,8 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" -#include "nspc.h" -#include "value.h" #include "instr.h" #include "emit.h" #include "escape.h" diff --git a/src/emit/escape.c b/src/emit/escape.c index e0c7ca47..3bef0a78 100644 --- a/src/emit/escape.c +++ b/src/emit/escape.c @@ -1,7 +1,6 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "instr.h" #include "emit.h" diff --git a/src/emit/memoize.c b/src/emit/memoize.c index 4e80f2b0..30ac5e33 100644 --- a/src/emit/memoize.c +++ b/src/emit/memoize.c @@ -1,14 +1,10 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "instr.h" #include "emit.h" #include "gwion.h" -#include "type.h" -#include "func.h" #include "memoize.h" struct Memoize_ { diff --git a/src/gwion.c b/src/gwion.c index 088bd3a5..7f64b80c 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -1,13 +1,7 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "context.h" -#include "type.h" -#include "func.h" -#include "value.h" #include "instr.h" #include "emit.h" #include "engine.h" diff --git a/src/gwiondata.c b/src/gwiondata.c index a8dc8468..9c5e0435 100644 --- a/src/gwiondata.c +++ b/src/gwiondata.c @@ -1,8 +1,7 @@ #include "gwion_util.h" #include "gwion_ast.h" +#include "gwion_env.h" #include "gwiondata.h" -#include "oo.h" -#include "env.h" #include "vm.h" #include "instr.h" #include "gwion.h" diff --git a/src/import/cdef.c b/src/import/cdef.c index c2d235ae..abf8d2ec 100644 --- a/src/import/cdef.c +++ b/src/import/cdef.c @@ -3,17 +3,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/checker.c b/src/import/checker.c index c588538e..be695536 100644 --- a/src/import/checker.c +++ b/src/import/checker.c @@ -4,17 +4,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/enum.c b/src/import/enum.c index bce6e62c..7fa75118 100644 --- a/src/import/enum.c +++ b/src/import/enum.c @@ -3,17 +3,12 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/fdef.c b/src/import/fdef.c index 94c65b96..221ace4f 100644 --- a/src/import/fdef.c +++ b/src/import/fdef.c @@ -3,17 +3,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" -#include "instr.h" #include "object.h" +#include "instr.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/internals.c b/src/import/internals.c index ea13b368..476c2848 100644 --- a/src/import/internals.c +++ b/src/import/internals.c @@ -1,10 +1,7 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" diff --git a/src/import/item.c b/src/import/item.c index 23137bfc..c623f421 100644 --- a/src/import/item.c +++ b/src/import/item.c @@ -1,10 +1,7 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" diff --git a/src/import/oper.c b/src/import/oper.c index 54835564..b9571708 100644 --- a/src/import/oper.c +++ b/src/import/oper.c @@ -3,17 +3,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/special.c b/src/import/special.c index 85d46b5c..4a7be140 100644 --- a/src/import/special.c +++ b/src/import/special.c @@ -3,17 +3,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/tdef.c b/src/import/tdef.c index 29a19d98..d1f9a798 100644 --- a/src/import/tdef.c +++ b/src/import/tdef.c @@ -3,17 +3,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/type.c b/src/import/type.c index 68b4f03c..af6e68e0 100644 --- a/src/import/type.c +++ b/src/import/type.c @@ -3,17 +3,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/import/udef.c b/src/import/udef.c index 7a93bdcb..2b052f62 100644 --- a/src/import/udef.c +++ b/src/import/udef.c @@ -3,17 +3,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "traverse.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "func.h" -#include "nspc.h" #include "gwion.h" #include "operator.h" #include "import.h" diff --git a/src/lib/array.c b/src/lib/array.c index bd350c26..cbcc5ac2 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -2,16 +2,13 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" #include "instr.h" #include "object.h" #include "array.h" #include "emit.h" -#include "value.h" #include "operator.h" #include "import.h" #include "traverse.h" diff --git a/src/lib/complex.c b/src/lib/complex.c index e2efac55..41a83747 100644 --- a/src/lib/complex.c +++ b/src/lib/complex.c @@ -1,14 +1,11 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" #include "instr.h" #include "object.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" diff --git a/src/lib/engine.c b/src/lib/engine.c index 63ac4f40..75a7ba31 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -1,18 +1,13 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "instr.h" -#include "nspc.h" -#include "type.h" #include "object.h" #include "emit.h" -#include "env.h" #include "vm.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "gwi.h" diff --git a/src/lib/event.c b/src/lib/event.c index f6a5bd0b..1e90b1de 100644 --- a/src/lib/event.c +++ b/src/lib/event.c @@ -1,13 +1,10 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" #include "instr.h" #include "object.h" -#include "value.h" #include "operator.h" #include "import.h" #include "gwi.h" diff --git a/src/lib/func.c b/src/lib/func.c index 4c36b831..3130b193 100644 --- a/src/lib/func.c +++ b/src/lib/func.c @@ -1,17 +1,12 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" -#include "value.h" -#include "func.h" #include "instr.h" #include "emit.h" #include "object.h" -#include "nspc.h" #include "operator.h" #include "import.h" #include "traverse.h" diff --git a/src/lib/gack.c b/src/lib/gack.c index 9b0d3620..dedcf095 100644 --- a/src/lib/gack.c +++ b/src/lib/gack.c @@ -3,15 +3,11 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "func.h" #include "object.h" #include "instr.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "gack.h" diff --git a/src/lib/instr.c b/src/lib/instr.c index ffeb0c2f..4b64d823 100644 --- a/src/lib/instr.c +++ b/src/lib/instr.c @@ -2,20 +2,17 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" #include "instr.h" #include "object.h" -#include "func.h" #include "array.h" -#include "nspc.h" #include "shreduler_private.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" +#include "emit.h" +#include "template.h" INSTR(DTOR_EOC) { const M_Object o = *(M_Object*)MEM(0); @@ -25,11 +22,6 @@ INSTR(DTOR_EOC) { vm_shred_exit(shred); } -#include "gwion.h" -#include "emit.h" -#include "value.h" -#include "template.h" - INSTR(PopArrayClass) { POP_REG(shred, SZ_INT); const M_Object obj = *(M_Object*)REG(-SZ_INT); diff --git a/src/lib/modules.c b/src/lib/modules.c index 932c9172..48508e63 100644 --- a/src/lib/modules.c +++ b/src/lib/modules.c @@ -2,18 +2,14 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "gwion.h" -#include "type.h" #include "instr.h" #include "object.h" -#include "value.h" #include "operator.h" #include "import.h" #include "ugen.h" -#include "func.h" #include "gwi.h" static DTOR(basic_dtor) { diff --git a/src/lib/object.c b/src/lib/object.c index 7457d6be..d5d0b5ff 100644 --- a/src/lib/object.c +++ b/src/lib/object.c @@ -2,13 +2,9 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" -#include "nspc.h" -#include "value.h" #include "instr.h" #include "object.h" #include "operator.h" @@ -16,7 +12,6 @@ #include "emit.h" #include "traverse.h" #include "parse.h" -#include "func.h" #include "specialid.h" #include "gwi.h" diff --git a/src/lib/opfunc.c b/src/lib/opfunc.c index 0b6045c7..d5e72a10 100644 --- a/src/lib/opfunc.c +++ b/src/lib/opfunc.c @@ -1,10 +1,7 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" #include "instr.h" #include "object.h" #include "emit.h" diff --git a/src/lib/prim.c b/src/lib/prim.c index eaf7dbb0..7a80bbca 100644 --- a/src/lib/prim.c +++ b/src/lib/prim.c @@ -1,14 +1,11 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" #include "instr.h" #include "object.h" #include "emit.h" -#include "value.h" #include "operator.h" #include "import.h" #include "gwi.h" diff --git a/src/lib/ptr.c b/src/lib/ptr.c index e26911c6..3a82cb25 100644 --- a/src/lib/ptr.c +++ b/src/lib/ptr.c @@ -2,15 +2,11 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" -#include "nspc.h" #include "instr.h" #include "object.h" -#include "value.h" #include "operator.h" #include "import.h" #include "emit.h" diff --git a/src/lib/shred.c b/src/lib/shred.c index 85d4e8c1..7110732b 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -1,16 +1,12 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" +#include "gwion_env.h" #include "gwion_thread.h" -#include "oo.h" #include "vm.h" -#include "env.h" -#include "type.h" #include "instr.h" #include "object.h" #include "shreduler_private.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "emit.h" @@ -236,7 +232,7 @@ ANN void fork_clean(const VM_Shred shred, const Vector v) { } vector_release(v); } -#include "nspc.h" + GWION_IMPORT(shred) { const Type t_shred = gwi_class_ini(gwi, "Shred", NULL); gwi_class_xtor(gwi, NULL, shred_dtor); diff --git a/src/lib/string.c b/src/lib/string.c index f7229f17..c51a02ae 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -4,19 +4,15 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" #include "instr.h" #include "object.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "emit.h" #include "specialid.h" -#include "func.h" #include "gwi.h" ANN static void push_string(const VM_Shred shred, const M_Object obj, const m_str c) { diff --git a/src/lib/tuple.c b/src/lib/tuple.c index 120cd231..22ab761e 100644 --- a/src/lib/tuple.c +++ b/src/lib/tuple.c @@ -1,22 +1,16 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "instr.h" -#include "nspc.h" -#include "type.h" #include "object.h" #include "emit.h" -#include "env.h" #include "vm.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "gwi.h" #include "traverse.h" -#include "value.h" #include "object.h" #include "parse.h" #include "tuple.h" diff --git a/src/lib/ugen.c b/src/lib/ugen.c index ffd2f100..3c44d32b 100644 --- a/src/lib/ugen.c +++ b/src/lib/ugen.c @@ -1,14 +1,10 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "gwion.h" -#include "type.h" -#include "instr.h" #include "object.h" -#include "value.h" +#include "instr.h" #include "operator.h" #include "import.h" #include "gwi.h" diff --git a/src/lib/vararg.c b/src/lib/vararg.c index 49f67449..ba52aa5c 100644 --- a/src/lib/vararg.c +++ b/src/lib/vararg.c @@ -1,24 +1,18 @@ -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" #include "instr.h" #include "emit.h" #include "object.h" #include "vararg.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "gwi.h" #include "specialid.h" #include "traverse.h" #include "parse.h" -#include "func.h" void free_vararg(MemPool p, struct Vararg_* arg) { xfree(arg->d); diff --git a/src/lib/vec.c b/src/lib/vec.c index 4ac56f66..e1a25bcb 100644 --- a/src/lib/vec.c +++ b/src/lib/vec.c @@ -1,13 +1,10 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" #include "instr.h" #include "object.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "driver.h" diff --git a/src/main.c b/src/main.c index 281e6a2a..eb630d98 100644 --- a/src/main.c +++ b/src/main.c @@ -1,9 +1,8 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" #include "arg.h" diff --git a/src/oo/context.c b/src/oo/context.c index 555dc4fd..6cf65e90 100644 --- a/src/oo/context.c +++ b/src/oo/context.c @@ -1,13 +1,8 @@ -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "nspc.h" +#include "gwion_env.h" #include "vm.h" #include "gwion.h" -#include "context.h" ANN static void free_context(const Context a, Gwion gwion) { REM_REF(a->nspc, gwion) diff --git a/src/oo/env.c b/src/oo/env.c index 1ca42590..cbcefeb7 100644 --- a/src/oo/env.c +++ b/src/oo/env.c @@ -1,18 +1,10 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "value.h" #include "operator.h" -#include "value.h" #include "traverse.h" -#include "type.h" -#include "context.h" -#include "nspc.h" -#include "mpool.h" #include "vm.h" #include "parse.h" diff --git a/src/oo/env_utils.c b/src/oo/env_utils.c index 7bec6eb5..fcadeb40 100644 --- a/src/oo/env_utils.c +++ b/src/oo/env_utils.c @@ -1,13 +1,7 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "value.h" +#include "gwion_env.h" #include "traverse.h" -#include "type.h" -#include "context.h" -#include "nspc.h" #include "vm.h" #include "parse.h" diff --git a/src/oo/nspc.c b/src/oo/nspc.c index 2dde7770..54d0f360 100644 --- a/src/oo/nspc.c +++ b/src/oo/nspc.c @@ -1,13 +1,7 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "nspc.h" -#include "value.h" -#include "func.h" #include "object.h" #include "gwion.h" #include "operator.h" diff --git a/src/oo/type.c b/src/oo/type.c index b02966c5..5cd0d2bf 100644 --- a/src/oo/type.c +++ b/src/oo/type.c @@ -1,16 +1,11 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "type.h" -#include "nspc.h" +#include "gwion_env.h" #include "vm.h" #include "traverse.h" #include "parse.h" #include "gwion.h" #include "tuple.h" -#include "context.h" ANN static void free_type(Type a, Gwion gwion) { if(GET_FLAG(a, template) || GET_FLAG(a, global)) { diff --git a/src/oo/value.c b/src/oo/value.c index 9007e86c..13cfdd6c 100644 --- a/src/oo/value.c +++ b/src/oo/value.c @@ -1,12 +1,8 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "gwion.h" -#include "value.h" -#include "type.h" ANN static void free_value(Value a, Gwion gwion) { const Type t = a->type; diff --git a/src/parse/check.c b/src/parse/check.c index ee100fc6..e3df1ea9 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -1,12 +1,7 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" -#include "func.h" #include "instr.h" #include "object.h" #include "traverse.h" @@ -15,12 +10,10 @@ #include "operator.h" #include "import.h" #include "parse.h" -#include "nspc.h" #include "match.h" #include "tuple.h" #include "emit.h" #include "specialid.h" -#include "context.h" ANN static Type check_exp(const Env env, Exp exp); ANN static m_bool check_stmt_list(const Env env, Stmt_List list); diff --git a/src/parse/did_you_mean.c b/src/parse/did_you_mean.c index e06b7a81..83e81bbb 100644 --- a/src/parse/did_you_mean.c +++ b/src/parse/did_you_mean.c @@ -1,13 +1,6 @@ -//#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "nspc.h" -#include "value.h" -#include "env.h" -#include "type.h" +#include "gwion_env.h" #ifdef min #undef min diff --git a/src/parse/func.c b/src/parse/func.c index 1e42b9c2..3bc7c7dc 100644 --- a/src/parse/func.c +++ b/src/parse/func.c @@ -1,14 +1,8 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" -#include "nspc.h" -#include "func.h" -#include "value.h" ANN static void free_func(Func a, Gwion gwion) { if(GET_FLAG(a, template) && !GET_FLAG(a, builtin)/* && a->def->d.code*/) @@ -26,12 +20,6 @@ ANN Func new_func(MemPool p, const m_str name, const Func_Def def) { return func; } -#include -#include "env.h" -#include "type.h" -#include "vm.h" -#include "gwion.h" - ANN2(1,2) Symbol func_symbol(const Env env, const m_str nspc, const m_str base, const m_str tmpl, const m_uint i) { const size_t base_len = strlen(base); diff --git a/src/parse/operator.c b/src/parse/operator.c index 1484c156..45b5773c 100644 --- a/src/parse/operator.c +++ b/src/parse/operator.c @@ -2,16 +2,11 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" -#include "type.h" #include "instr.h" #include "emit.h" -#include "value.h" -#include "func.h" -#include "nspc.h" #include "operator.h" typedef Type (*f_type)(const Env env, const Exp exp); diff --git a/src/parse/scan0.c b/src/parse/scan0.c index 53a02301..106eba98 100644 --- a/src/parse/scan0.c +++ b/src/parse/scan0.c @@ -1,12 +1,7 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "type.h" -#include "value.h" -#include "func.h" -#include "nspc.h" +#include "gwion_env.h" #include "vm.h" #include "traverse.h" #include "template.h" @@ -17,8 +12,6 @@ #include "operator.h" #include "import.h" -#include "context.h" - static inline void add_type(const Env env, const Nspc nspc, const Type t) { nspc_add_type_front(nspc, insert_symbol(t->name), t); } diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 0abc6ec7..c2d04e6a 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -1,16 +1,10 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "type.h" -#include "nspc.h" -#include "value.h" -#include "func.h" +#include "gwion_env.h" #include "vm.h" #include "traverse.h" #include "template.h" #include "parse.h" -#include "context.h" ANN static m_bool scan1_stmt_list(const Env env, Stmt_List list); ANN static m_bool scan1_stmt(const Env env, Stmt stmt); diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 852a8e02..e6fe1bca 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -1,22 +1,15 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "value.h" -#include "func.h" #include "template.h" #include "traverse.h" #include "parse.h" -#include "nspc.h" #include "operator.h" #include "object.h" #include "instr.h" #include "import.h" #include "tuple.h" -#include "context.h" ANN static m_bool scan2_stmt(const Env, const Stmt); ANN static m_bool scan2_stmt_list(const Env, Stmt_List); diff --git a/src/parse/scanx.c b/src/parse/scanx.c index 7414900d..d9b52969 100644 --- a/src/parse/scanx.c +++ b/src/parse/scanx.c @@ -1,10 +1,6 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "type.h" -#include "nspc.h" +#include "gwion_env.h" #include "vm.h" #include "template.h" #include "traverse.h" diff --git a/src/parse/stage.c b/src/parse/stage.c index 8d582020..12646234 100644 --- a/src/parse/stage.c +++ b/src/parse/stage.c @@ -1,9 +1,6 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "value.h" -#include "type.h" +#include "gwion_env.h" ANN m_uint union_push(const Env env, const Union_Def udef) { const Type type = udef->xid ? udef->value->type : udef->type_xid ? diff --git a/src/parse/template.c b/src/parse/template.c index 4e61c8ea..0fb1e23f 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -1,13 +1,7 @@ -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "func.h" -#include "value.h" -#include "nspc.h" #include "traverse.h" #include "template.h" #include "vm.h" diff --git a/src/parse/traverse.c b/src/parse/traverse.c index dba8c910..c56134d5 100644 --- a/src/parse/traverse.c +++ b/src/parse/traverse.c @@ -1,7 +1,6 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "traverse.h" ANN m_bool traverse_ast(const Env env, const Ast ast) { diff --git a/src/parse/type_decl.c b/src/parse/type_decl.c index 9f4f0259..42290b6e 100644 --- a/src/parse/type_decl.c +++ b/src/parse/type_decl.c @@ -1,22 +1,13 @@ -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" -#include "nspc.h" -#include "type.h" +#include "gwion_env.h" #include "vm.h" #include "traverse.h" #include "parse.h" -#include "context.h" - #define STR_NONNULL ":nonnull" #define STRLEN_NONNULL strlen(STR_NONNULL) -#include "func.h" - ANN Type type_nonnull(const Env env, const Type base) { char c[strlen(base->name) + 9]; sprintf(c, "%s%s", base->name, STR_NONNULL); diff --git a/src/parse/type_utils.c b/src/parse/type_utils.c index 2b710574..5486ebb5 100644 --- a/src/parse/type_utils.c +++ b/src/parse/type_utils.c @@ -1,9 +1,6 @@ -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "traverse.h" #include "parse.h" diff --git a/src/pass.c b/src/pass.c index 9c2684f8..0ef7fb69 100644 --- a/src/pass.c +++ b/src/pass.c @@ -1,8 +1,7 @@ #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "instr.h" #include "emit.h" #include "gwion.h" diff --git a/src/plug.c b/src/plug.c index dd11e1aa..b702d2c4 100644 --- a/src/plug.c +++ b/src/plug.c @@ -1,4 +1,3 @@ -#include #ifndef BUILD_ON_WINDOWS #include #include @@ -7,15 +6,12 @@ #endif #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "instr.h" #include "object.h" -#include "type.h" #include "import.h" typedef m_bool (*import)(Gwi); diff --git a/src/vm/driver.c b/src/vm/driver.c index da06f6f9..71028033 100644 --- a/src/vm/driver.c +++ b/src/vm/driver.c @@ -1,13 +1,8 @@ -#include -#include -#include #include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" #include "gwion.h" #include "driver.h" diff --git a/src/vm/shreduler.c b/src/vm/shreduler.c index 6d1e4371..baea4e95 100644 --- a/src/vm/shreduler.c +++ b/src/vm/shreduler.c @@ -1,7 +1,7 @@ #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" #include "object.h" #include "driver.h" diff --git a/src/vm/vm.c b/src/vm/vm.c index 444a7d73..f690029e 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -1,26 +1,17 @@ -#include -#include #include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "nspc.h"//dot func -#include "func.h"//dot func -#include "type.h" #include "instr.h" #include "object.h" #include "ugen.h" #include "shreduler_private.h" #include "emit.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" #include "map_private.h" - -#include "value.h" #include "gack.h" #include "array.h" diff --git a/src/vm/vm_code.c b/src/vm/vm_code.c index e56f9035..dcb7d47e 100644 --- a/src/vm/vm_code.c +++ b/src/vm/vm_code.c @@ -1,18 +1,12 @@ -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" +#include "gwion_env.h" #include "vm.h" -#include "env.h" -#include "type.h" -#include "func.h" #include "instr.h" #include "object.h" #include "array.h" #include "memoize.h" #include "gwion.h" -#include "value.h" #include "operator.h" #include "import.h" diff --git a/src/vm/vm_name.c b/src/vm/vm_name.c index e16c0c25..19b0b004 100644 --- a/src/vm/vm_name.c +++ b/src/vm/vm_name.c @@ -1,6 +1,3 @@ -#include -#include -#include #include "gwion_util.h" #include "gwion_ast.h" diff --git a/src/vm/vm_shred.c b/src/vm/vm_shred.c index e81944fd..eca7b796 100644 --- a/src/vm/vm_shred.c +++ b/src/vm/vm_shred.c @@ -1,9 +1,6 @@ -#include -#include #include "gwion_util.h" #include "gwion_ast.h" -#include "oo.h" -#include "env.h" +#include "gwion_env.h" #include "vm.h" #include "object.h" #include "gwion.h" -- 2.43.0