Scope type;
Scope func;
Scope trait;
- MP_Vector *using;
+ MP_Vector *gwusing;
} NspcInfo;
typedef struct NspcOp_ {
tflag_packed = 1 << 23,
tflag_compound = 1 << 24,
tflag_release = 1 << 25, // mark structs that need release
- tflag_primitive = 1 << 26, // mark structs that need release
+ tflag_primitive = 1 << 26,
+ tflag_cxx = 1 << 27, // do not emit parent ctors for cxx types
} __attribute__((packed));
struct Type_ {
#ifndef __IMPORT_FUNC
#define __IMPORT_FUNC
-ANN bool gwi_func_ini(const Gwi gwi, const __restrict__ m_str type,
- const __restrict__ m_str name);
-ANN bool gwi_func_arg(const Gwi gwi, const __restrict__ m_str t,
- const __restrict__ m_str n);
+ANN bool gwi_func_ini(const Gwi gwi, const m_str type,
+ const m_str name);
+ANN bool gwi_func_arg(const Gwi gwi, const m_str t,
+ const m_str n);
ANN bool gwi_func_end(const Gwi gwi, const f_xfun addr, const ae_flag flag);
-ANN bool gwi_fptr_ini(const Gwi gwi, const m_str __restrict__ type,
- const __restrict__ m_str name);
+ANN bool gwi_fptr_ini(const Gwi gwi, const m_str type,
+ const m_str name);
ANN Type gwi_fptr_end(const Gwi gwi, const ae_flag flag);
-ANN bool gwi_func_arg(const Gwi gwi, const restrict m_str t,
- const restrict m_str n);
+ANN bool gwi_func_arg(const Gwi gwi, const m_str t,
+ const m_str n);
ANN void ck_clean_fdef(MemPool, ImportCK *);
#endif
#define RET_NSPC(exp) \
++env->scope->depth; \
- const uint32_t nusing = env->curr->info->using \
- ? env->curr->info->using->len \
+ const uint32_t nusing = env->curr->info->gwusing \
+ ? env->curr->info->gwusing->len \
: 0; \
nspc_push_value(env->gwion->mp, env->curr); \
const bool ret = exp; \
nspc_pop_value(env->gwion->mp, env->curr); \
if(nusing) \
- env->curr->info->using->len = nusing; \
+ env->curr->info->gwusing->len = nusing; \
--env->scope->depth; \
return ret;
clean_stmt(a, b->stmt);
}
+ANN static void clean_stmt_using(Clean *a, Stmt_Using b) {
+ if(b->tag.sym)
+ clean_exp(a, b->d.exp);
+ else
+ clean_type_decl(a, b->d.td);
+}
+
+ANN static void clean_stmt_import(Clean *a, Stmt_Import b) {
+ if(b->selection) {
+ for(uint32_t i = 0; i < b->selection->len; i++) {
+ Stmt_Using item = mp_vector_at(b->selection, struct Stmt_Using_, i);
+ if(item->d.exp)
+ clean_exp(a, item->d.exp);
+ }
+ }
+}
+
+
ANN static void clean_dummy(Clean *a NUSED, void *b NUSED) {}
#define clean_stmt_jump clean_dummy
#define clean_stmt_pp clean_dummy
#define clean_stmt_retry clean_dummy
#define clean_stmt_spread clean_dummy
-// TODO: check me
-#define clean_stmt_using clean_dummy
-
DECL_STMT_FUNC(clean, void, Clean *)
ANN static void clean_stmt(Clean *a, Stmt* b) {
clean_stmt_func[b->stmt_type](a, &b->d);
static ArrayInfo *emit_array_extend(const Emitter emit, const Type t,
Exp* e, const uint is_ref);
ANN static bool emit_pre_ctor(const Emitter emit, const Type type) {
- if (type->info->parent) {
+ if (type->info->parent && !tflag(type, tflag_cxx)) {
CHECK_B(emit_pre_ctor(emit, type->info->parent));
if (tflag(type, tflag_typedef) && type->info->parent->array_depth)
CHECK_B(emit_array_extend(emit, type, type->info->cdef->base.ext->array->exp, false));
#define emit_stmt_until emit_stmt_flow
#define emit_stmt_spread dummy_func
#define emit_stmt_using dummy_func
+#define emit_stmt_import dummy_func
DECL_STMT_FUNC(emit, bool, Emitter);
const Nspc nspc = (Nspc)vector_at(v, i - 1);
RETURN_TYPE(nspc_lookup_type1(nspc, xid));
}
- if(env->curr->info->using) {
- for(uint32_t i = 0; i < env->curr->info->using->len; i++) {
- Stmt_Using using = *mp_vector_at(env->curr->info->using, Stmt_Using, i);
- if(!using->alias.sym) {
+ if(env->curr->info->gwusing) {
+ for(uint32_t i = 0; i < env->curr->info->gwusing->len; i++) {
+ Stmt_Using using = *mp_vector_at(env->curr->info->gwusing, Stmt_Using, i);
+ if(!using->tag.sym) {
const Type owner = known_type(env, using->d.td);
if(owner) {
const Type ret = nspc_lookup_type0(owner->nspc, xid);
if(ret) return ret;
}
- } else if(xid == using->alias.sym) {
+ } else if(xid == using->tag.sym) {
if(!using->d.exp->type)
CHECK_B(traverse_exp(env, using->d.exp));
if(is_class(env->gwion, using->d.exp->type))
return using->d.exp->type->info->base_type;
- ERR_B(using->alias.loc, "found an alias %s but it's not a type", s_name(using->alias.sym));
+ ERR_B(using->tag.loc, "found an alias %s but it's not a type", s_name(using->tag.sym));
}
}}
return NULL;
nspc_free_trait(a, gwion);
if(a->operators) free_operators(a->operators, gwion);
nspc_free_type(a, gwion);
- if (a->info->using)
- free_mp_vector(gwion->mp, Stmt_Using, a->info->using);
+ if (a->info->gwusing)
+ free_mp_vector(gwion->mp, Stmt_Using, a->info->gwusing);
if (a->class_data && a->class_data_size)
mp_free2(gwion->mp, a->class_data_size, a->class_data);
if (a->vtable.ptr) vector_release(&a->vtable);
const Value v = (Value)map_at(map, idx - 1);
if (tflag(v->type, tflag_compound))
compound_release(shred, v->type, data + SZ_INT);
+ // what if there is an union instead
}
}
return v->type;
}
}
- if(env->curr->info->using) {
- for(uint32_t i = 0; i < env->curr->info->using->len; i++) {
- Stmt_Using using = *mp_vector_at(env->curr->info->using, Stmt_Using, i);
- if(!using->alias.sym) {
+ if(env->curr->info->gwusing) {
+ for(uint32_t i = 0; i < env->curr->info->gwusing->len; i++) {
+ Stmt_Using using = *mp_vector_at(env->curr->info->gwusing, Stmt_Using, i);
+ if(!using->tag.sym) {
// NOTE: we know type is valid and has nspc
const Type type = known_type(env, using->d.td);
Value value = nspc_lookup_value1(type->nspc, sym);
exp->d.exp_dot.xid = insert_symbol(value->name);
return check_exp(env, exp);
}
- } else if(sym == using->alias.sym) {
+ } else if(sym == using->tag.sym) {
Exp *exp = prim_exp(data);
+ const loc_t loc = exp->loc;
Exp *base = cpy_exp(env->gwion->mp, using->d.exp);
*exp = *base;
+ exp->loc = loc;
mp_free2(env->gwion->mp, sizeof(Exp), base);
return check_exp(env, exp);
}
}
ANN static bool check_stmt_using(const Env env, const Stmt_Using stmt) {
- if(!stmt->alias.sym) {
+ if(!stmt->tag.sym) {
DECL_B(const Type, type, = known_type(env, stmt->d.td));
for(m_uint i = 0; i < map_size(&type->nspc->info->value->map); ++i) {
const Symbol sym = (Symbol)VKEY(&type->nspc->info->value->map, i);
}
}
} else {
- const Value value = nspc_lookup_value1(env->curr, stmt->alias.sym);
+ const Value value = nspc_lookup_value1(env->curr, stmt->tag.sym);
if(value) {
char msg[256];
sprintf(msg, "{Y}%s{0} is already defined", value->name);
- gwlog_error(_(msg), NULL, env->name, stmt->alias.loc, 0);
+ gwlog_error(_(msg), NULL, env->name, stmt->tag.loc, 0);
declared_here(value);
return false;
}
if(!stmt->d.exp->type)
CHECK_B(check_exp(env, stmt->d.exp));
}
- mp_vector_add(env->gwion->mp, &env->curr->info->using, Stmt_Using, stmt);
+ mp_vector_add(env->gwion->mp, &env->curr->info->gwusing, Stmt_Using, stmt);
return true;
}
+#define check_stmt_import dummy_func
+
#define check_stmt_retry dummy_func
#define check_stmt_spread dummy_func
DECL_STMT_FUNC(check, bool, Env)
ANN bool check_stmt_list(const Env env, Stmt_List l) {
bool ok = true;
- const uint32_t nusing = env->curr->info->using
- ? env->curr->info->using->len
+ const uint32_t nusing = env->curr->info->gwusing
+ ? env->curr->info->gwusing->len
: 0;
for(m_uint i = 0; i < l->len; i++) {
Stmt* stmt = mp_vector_at(l, Stmt, i);
if(!check_stmt(env, stmt))
POISON_NODE(ok, env, stmt);
}
- if(env->curr->info->using)
- env->curr->info->using->len = nusing;
+ if(env->curr->info->gwusing)
+ env->curr->info->gwusing->len = nusing;
return ok;
}
ANN static bool scan0_stmt_list(const Env env, Stmt_List l) {
bool ok = true;
- const uint32_t nusing = env->curr->info->using
- ? env->curr->info->using->len
+ const uint32_t nusing = env->curr->info->gwusing
+ ? env->curr->info->gwusing->len
: 0;
for(m_uint i = 0; i < l->len; i++) {
Stmt* stmt = mp_vector_at(l, Stmt, i);
if (stmt->stmt_type == ae_stmt_pp) {
if (stmt->d.stmt_pp.pp_type == ae_pp_include)
env->name = stmt->d.stmt_pp.data;
- else if (stmt->d.stmt_pp.pp_type == ae_pp_import) {
- if(!plugin_ini(env->gwion, stmt->d.stmt_pp.data, stmt->loc))
- POISON_NODE(ok, env, stmt);
- }
} else if(stmt->stmt_type == ae_stmt_using) {
- if(!env->curr->info->using)
- env->curr->info->using = new_mp_vector(env->gwion->mp, Stmt_Using, 0);
- mp_vector_add(env->gwion->mp, &env->curr->info->using, Stmt_Using, &stmt->d.stmt_using);
- } /*else if (stmt->stmt_type == ae_stmt_spread) {
- if(!spreadable(env)) // TODO: we can prolly get rid of this
- ERR_OK_NODE(ok, stmt, stmt->loc, "spread statement outside of variadic environment");
- }*/
+ if(!env->curr->info->gwusing)
+ env->curr->info->gwusing = new_mp_vector(env->gwion->mp, Stmt_Using, 0);
+ mp_vector_add(env->gwion->mp, &env->curr->info->gwusing, Stmt_Using, &stmt->d.stmt_using);
+ } else if(stmt->stmt_type == ae_stmt_import) {
+ if(!env->scope->depth && !env->class_def) {
+ if(!plugin_ini(env->gwion, s_name(stmt->d.stmt_import.tag.sym), stmt->loc))
+ POISON_NODE(ok, env, stmt);
+ } else {
+ env_err(env, stmt->loc, "import statements must be at file scope");
+ POISON_NODE(ok, env, stmt);
+ }
+ }
}
- if(env->curr->info->using && env->scope->depth)
- env->curr->info->using->len = nusing;
+ if(env->curr->info->gwusing && env->scope->depth)
+ env->curr->info->gwusing->len = nusing;
return ok;
}
ANN static inline bool scan1_stmt_using(const restrict Env env,
const Stmt_Using stmt) {
- if(stmt->alias.sym)
+ if(stmt->tag.sym)
CHECK_B(scan1_exp(env, stmt->d.exp));
- if(!env->curr->info->using)
- env->curr->info->using = new_mp_vector(env->gwion->mp, Stmt_Using, 0);
- mp_vector_add(env->gwion->mp, &env->curr->info->using, Stmt_Using, stmt);
+ if(!env->curr->info->gwusing)
+ env->curr->info->gwusing = new_mp_vector(env->gwion->mp, Stmt_Using, 0);
+ mp_vector_add(env->gwion->mp, &env->curr->info->gwusing, Stmt_Using, stmt);
return true;
}
+#define scan1_stmt_import dummy_func
+
ANN static inline bool
_scan1_stmt_match(const restrict Env env, const Stmt_Match stmt) {
if (stmt->where) CHECK_B(scan1_stmt(env, stmt->where));
ANN static bool scan1_stmt_list(const Env env, Stmt_List l) {
uint32_t i;
bool ok = true;
- const uint32_t nusing = env->curr->info->using
- ? env->curr->info->using->len
+ const uint32_t nusing = env->curr->info->gwusing
+ ? env->curr->info->gwusing->len
: 0;
for(i = 0; i < l->len; i++) {
Stmt* stmt = mp_vector_at(l, Stmt, i);
}
if(end_flow(stmt)) break;
}
- if(env->curr->info->using)
- env->curr->info->using->len = nusing;
+ if(env->curr->info->gwusing)
+ env->curr->info->gwusing->len = nusing;
if(++i < l->len) dead_code(env, l, i);
return ok;
}
ANN static inline bool scan2_stmt_using(const restrict Env env,
const Stmt_Using stmt) {
- if(stmt->alias.sym)
+ if(stmt->tag.sym)
CHECK_B(scan2_exp(env, stmt->d.exp));
- mp_vector_add(env->gwion->mp, &env->curr->info->using, Stmt_Using, stmt);
+ mp_vector_add(env->gwion->mp, &env->curr->info->gwusing, Stmt_Using, stmt);
return true;
}
+#define scan2_stmt_import dummy_func
+
#define scan2_stmt_spread dummy_func
DECL_STMT_FUNC(scan2, bool, Env)
ANN static bool scan2_stmt_list(const Env env, Stmt_List l) {
bool ok = true;
- const uint32_t nusing = env->curr->info->using
- ? env->curr->info->using->len
+ const uint32_t nusing = env->curr->info->gwusing
+ ? env->curr->info->gwusing->len
: 0;
for(m_uint i = 0; i < l->len; i++) {
Stmt* stmt = mp_vector_at(l, Stmt, i);
if(!scan2_stmt(env, stmt))
POISON_NODE(ok, env, stmt);
}
- if(env->curr->info->using)
- env->curr->info->using->len = nusing;
+ if(env->curr->info->gwusing)
+ env->curr->info->gwusing->len = nusing;
return ok;
}
struct SpecialId_ *spid = specialid_get(a->env->gwion, b->d.var);
if(spid) return true;
if (!b->value) {// assume it's an operator
+ // turns out it could be a _ in a case expression
env_err(a->env, exp_self(b)->loc, "missing value for operator");
return false;
}
}
#define validate_stmt_using dummy_func
+#define validate_stmt_import dummy_func
DECL_STMT_FUNC(validate, bool, Validate*)
ANN static bool validate_stmt(Validate *a, Stmt* b) {
return true;
}
+ANN static bool _plugin_ini(struct Gwion_ *gwion, const m_str iname, const loc_t loc, const bool initial);
+
ANN static bool dependencies(struct Gwion_ *gwion, const Plug plug, const loc_t loc) {
const gwdepend_t dep = plug->depend;
bool ret = true;
m_str *const base = dep();
m_str * deps = base;
while (*deps) {
- if(!plugin_ini(gwion, *deps, loc)) {
- gw_err("%s: no such plugin (dependency)\n", *deps);
+ if(!_plugin_ini(gwion, *deps, loc, false)) {
+ env_err(gwion->env, loc, "%s: no such plugin (dependency)\n", *deps);
ret = false;
}
++deps;
}
ANN static bool start(const Plug plug, const Gwion gwion, const m_str iname, const loc_t loc) {
- if(!plug->plugin) return false;
+ if(!plug->plugin) {
+ env_err(gwion->env, loc, "%s: file exist but does not contain plugin\n", iname);
+ return false;
+ }
const bool cdoc = gwion->data->cdoc;
gwion->data->cdoc = 0; // check cdoc
CHECK_B(dependencies(gwion, plug, loc));
return true;
}
-ANN static bool _plugin_ini(struct Gwion_ *gwion, const m_str iname, const loc_t loc) {
+ANN static bool _plugin_ini(struct Gwion_ *gwion, const m_str iname, const loc_t loc, const bool initial) {
const Map map = &gwion->data->plugs->map;
for (m_uint i = 0; i < map_size(map); ++i) {
const Plug plug = (Plug)VVAL(map, i);
const m_str base = (m_str)VKEY(map, i);
if (!strcmp(iname, base)) {
if (!plug->nspc) return start(plug, gwion, iname, loc);
- else return started(plug, gwion, iname);
+ if(initial)
+ env_warn(gwion->env, loc, "%s already loaded", iname); // should be warning
+ return started(plug, gwion, iname);
}
}
return false;
ANN bool plugin_ini(struct Gwion_ *gwion, const m_str iname, const loc_t loc) {
const Env env = gwion->env;
- if(!_plugin_ini(gwion, iname, loc)) {
+ if(!_plugin_ini(gwion, iname, loc, true)) {
env_err(env, loc, "%s: no such plugin\n", iname);
return false;
}
ANN gwdriver_t driver_ini(const struct Gwion_ *gwion, struct SoundInfo_ *si) {
const Map map = &gwion->data->plugs->map;
- m_str dname = strdup(si->arg);
+ // NOTE: we can do better
+ // calculate lenght of the string til `=` if it exists
+ // maybe implement some mstrndup function?
+ // or even an mstr function that returns a string up to char
+ m_str dname = mstrdup(gwion->mp, si->arg);
m_str opt = strchr(dname, '=');
if (opt) *opt = '\0';
for (m_uint i = 0; i < map_size(map); ++i) {
if (!strcmp(name, dname)) {
const Plug plug = (Plug)VVAL(map, i);
const gwdriver_t drv = plug->driver;
- free(dname);
+ free_mstr(gwion->mp, dname);
return drv;
}
}
gw_err("%s: no such driver\n", dname);
- free(dname);
+ free_mstr(gwion->mp, dname);
return NULL;
}
}
return NULL;
}
+
+// TODO: make some error API from this
+// NOTE: warn when a plugin is already loaded (but not when it's a dependency)
+// NOTE: warn when a dependency is already loaded
+// some question arises from the use of :[] in plug names
+//
+//
+// NOTE: plugs could use args just like modules
+//
+// NOTE: we need gwerr gwwarn gwout
+// also to set in gwiond?
+// or just set one
+// maybe have the message be [Foo] prefixed
}
#define sema_stmt_using dummy_func
+#define sema_stmt_import dummy_func
DECL_STMT_FUNC(sema, bool, Sema*)
ANN static bool sema_stmt(Sema *a, Stmt* b, bool in_list) {
Stmt* c = mp_vector_at(*b, Stmt, i);
if(!sema_stmt(a, c, true))
POISON_OK(a, c, ok);
+
+ if(c->stmt_type == ae_stmt_import &&
+ c->d.stmt_import.selection) {
+ const uint32_t len = (*b)->len;
+ ImportList selection = c->d.stmt_import.selection;
+ c->d.stmt_import.selection = NULL;
+ mp_vector_resize(a->mp, b, sizeof(Stmt), len + selection->len);
+ memmove((*b)->ptr + (i + 1 + selection->len) * sizeof(Stmt),
+ (*b)->ptr + (i + 1) * sizeof(Stmt),
+ (len - i) * sizeof(Stmt));
+ for(uint32_t j = 0; j < selection->len; j++) {
+ Stmt *stmt = mp_vector_at(*b, Stmt, i + j + 1);
+ struct Stmt_Using_ using = *mp_vector_at(selection, struct Stmt_Using_, j);
+ stmt->d.stmt_using = using;
+ stmt->stmt_type = ae_stmt_using;
+ stmt->loc = using.tag.loc;
+ stmt->poison = false;
+ }
+ stmt_list = b;
+ free_mp_vector(a->mp, struct Stmt_Using_, selection);
+ }
+
}
a->stmt_list = stmt_list;
return ok;
-#import NonExisting
+import NonExisting;
var ftbl f;
<<< var SinOsc s >>>;
-#import get_module
+import get_module;
<<< __file__ >>>;
-#import array
+import array;
<<< __file__ >>>;
-#import array_in_var_name
+import array_in_var_name;
<<< __file__ >>>;
-#import array_in_var_name_fail
+import array_in_var_name_fail;
<<< __file__ >>>;
-#import array_incoherent_in_var_name
+import array_incoherent_in_var_name;
<<< __file__ >>>;
-#import array_invalid_in_var_name
+import array_invalid_in_var_name;
<<< __file__ >>>;
-#import callback
+import callback;
<<< __file__ >>>;
-#import class_template
+import class_template;
var ClassTemplate:[int, int] ct;
<<< ct.key >>>;
-#import class_template_fail
+import class_template_fail;
<<< __file__ >>>;
-#import class_template_invalid
+import class_template_invalid;
<<< __file__ >>>;
-#import compile_file
+import compile_file;
<<< __file__ >>>;
-#import compile_string
+import compile_string;
<<< __file__ >>>;
-#import coverage
-#import coverage
+import coverage;
+import coverage;
<<< var float f >>>;
var Coverage c;
-#import deps
+import deps;
<<< __file__ >>>;
-#import empty_union
+import empty_union;
<<< __file__ >>>;
-#import end_class
+import end_class;
<<< __file__ >>>;
-#import enum
+import enum;
#! typed global enum
<<< TYPED_ENUM0 >>>;
-#import enum_fail
+import enum_fail;
<<< __file__ >>>;
-#import enum_fail2
+import enum_fail2;
<<< __file__ >>>;
-#import enum_fail3
+import enum_fail3;
<<< __file__ >>>;
-#import extend_array
+import extend_array;
var ArrayExt a;
<<< a >>>;
<<< a.size() >>>;
-#import fail_on_next_arg
+import fail_on_next_arg;
<<< __file__ >>>;
-#import fail_on_next_arg2
+import fail_on_next_arg2;
<<< __file__ >>>;
-#import fptr
+import fptr;
fun void test(){ <<< "test" >>>; }
var PtrType ptr;
test();
-#import fptr_tmpl
+import fptr_tmpl;
<<< __file__ >>>;
-#import fptr_tmpl_fail
+import fptr_tmpl_fail;
<<< __file__ >>>;
-#import func_fail
+import func_fail;
<<< __file__ >>>;
-#import func_fail2
+import func_fail2;
<<< __file__ >>>;
-#import func_fail3
+import func_fail3;
<<< __file__ >>>;
-#import func_fail4
+import func_fail4;
<<< __file__ >>>;
-#import func_subscript_not_empty
+import func_subscript_not_empty;
<<< __file__ >>>;
-#import func_tmpl
+import func_tmpl;
test:[int](1);
test(1);
-#import func_tmpl_fail
+import func_tmpl_fail;
<<< __file__ >>>;
-#import func_too_many_arg
+import func_too_many_arg;
<<< __file__ >>>;
-#import global_func
+import global_func;
<<< test >>>;
<<< 1 => test >>>;
-#import global_var
+import global_var;
<<< i >>>;
<<< "other test" :=> i >>>;
<<< 12 :=> f >>>;
-#import invalid_arg
+import invalid_arg;
<<< __file__ >>>;
-#import invalid_array
+import invalid_array;
<<< __file__ >>>;
-#import invalid_func
+import invalid_func;
<<< __file__ >>>;
-#import invalid_names
+import invalid_names;
<<< __file__ >>>;
-#import invalid_names0
+import invalid_names0;
<<< __file__ >>>;
-#import invalid_names1
+import invalid_names1;
<<< __file__ >>>;
-#import invalid_names2
+import invalid_names2;
<<< __file__ >>>;
-#import invalid_names3
+import invalid_names3;
<<< __file__ >>>;
-#import invalid_type1
+import invalid_type1;
<<< __file__ >>>;
-#import invalid_type2
+import invalid_type2;
<<< __file__ >>>;
-#import invalid_type3
+import invalid_type3;
<<< __file__ >>>;
-#import mk_type_array
+import mk_type_array;
<<< __file__ >>>;
-#import no_import
+import no_import;
<<< __file__ >>>;
-#import not_importing
+import not_importing;
<<< __file__ >>>;
-#import pass
+import pass;
<<< __file__ >>>;
-#import specialid_emit
+import specialid_emit;
<<< testid >>>;
-#import static_string
+import static_string;
#!<<< StaticString.self >>>;
<<< self >>>;
-#import str2td
+import str2td;
<<< __file__ >>>;
-#import str2list_fail
+import str2list_fail;
<<< __file__ >>>;
-#import struct
+import struct;
<<< var float f >>>;
var Struct c;
-#import template_arg
+import template_arg;
<<< __file__ >>>;
-#import trig
+import trig;
var Trig trig => dac;
adc :=> trig;
adc :=< trig;
-#import typedef
+import typedef;
var Typedef t;
#!fun int test(int i) { <<< i >>>; }
#!test :=> t;
-#import typedef_fail
+import typedef_fail;
<<< __file__ >>>;
-#import typedef_tmpl
+import typedef_tmpl;
<<< __file__ >>>;
-#import ugen_connect
+import ugen_connect;
<<< __file__ >>>;
-#import union
+import union;
var Union u;
<<< u.i >>>;
<<< 12 :=> u.f >>>;
-#import union_fail_exp
+import union_fail_exp;
<<< __file__ >>>;
-#import union_member
+import union_member;
<<< __file__ >>>;
-#import union_name
+import union_name;
<<< my_union >>>;
<<<my_union.i>>>;
-#import union_tmpl
+import union_tmpl;
<<< var U:[Event] u>>>;
<<< u.a >>>;
-#import union_tmpl_fail
+import union_tmpl_fail;
<<< __file__ >>>;
-#import union_tmpl_fail2
+import union_tmpl_fail2;
<<< __file__ >>>;
-#import union_tmpl_fail3
+import union_tmpl_fail3;
<<< __file__ >>>;
-#import vm_remove
+import vm_remove;
test(12);
test(1);