-Subproject commit 04876e5a68a4547238939b32e245f40b66fce14a
+Subproject commit ab74f8faf9335b74d5bbad7513c20e0e5243cdc1
if(stmt->pp_type == ae_pp_pragma) {
if(!strncmp(stmt->data, "memoize", strlen("memoize")))
emit->info->memoize = strtol(stmt->data + 7, NULL, 10);
- }
+ } else if(stmt->pp_type == ae_pp_include)
+ emit->env->name = stmt->data;
return GW_OK;
}
return dl_func_init(gwi, type, name);
}
-ANN static Fptr_Def import_fptr(const Gwi gwi, ae_flag flag) {
+ANN static Fptr_Def import_fptr(const Gwi gwi) {
Func_Base *base = gwi_func_base(gwi, gwi->ck);
return new_fptr_def(gwi->gwion->mp, base);
}
ANN Type gwi_fptr_end(const Gwi gwi, const ae_flag flag) {
CHECK_BO(ck_ok(gwi, ck_fdef))
- DECL_OO(const Fptr_Def, fptr, = import_fptr(gwi, flag))
+ DECL_OO(const Fptr_Def, fptr, = import_fptr(gwi))
// what happens if it is in a template class ?
const m_bool ret = traverse_fptr_def(gwi->gwion->env, fptr);
if(fptr->base->func) // is it needed ?
#define check_stmt_while check_stmt_flow
#define check_stmt_until check_stmt_flow
-#define check_stmt_pp dummy_func
+
+ANN static m_bool check_stmt_pp(const Env env, const Stmt_PP stmt) {
+ if(stmt->pp_type == ae_pp_include)
+ env->name = stmt->data;
+ return GW_OK;
+}
+
DECL_STMT_FUNC(check, m_bool , Env)
ANN m_bool check_stmt(const Env env, const Stmt stmt) {
return t;
}
+ANN static m_bool scan0_stmt_list(const Env env, Stmt_List list) {
+ do if(list->stmt->stmt_type == ae_stmt_pp && list->stmt->d.stmt_pp.pp_type == ae_pp_include)
+ env->name = list->stmt->d.stmt_pp.data;
+ while((list = list->next));
+ return GW_OK;
+}
+
ANN static m_bool scan0_section(const Env env, const Section* section) {
if(section->section_type == ae_section_class)
return scan0_class_def(env, section->d.class_def);
return scan0_fptr_def(env, section->d.fptr_def);
if(section->section_type == ae_section_type)
return scan0_type_def(env, section->d.type_def);
+ if(section->section_type == ae_section_type)
+ return scan0_stmt_list(env, section->d.stmt_list);
return GW_OK;
}
#define scan1_stmt_break (void*)dummy_func
#define scan1_stmt_jump (void*)dummy_func
#define scan1_stmt_return scan1_stmt_exp
-#define scan1_stmt_pp (void*)dummy_func
+
+ANN static m_bool scan1_stmt_pp(const Env env, const Stmt_PP stmt) {
+ if(stmt->pp_type == ae_pp_include)
+ env->name = stmt->data;
+ return GW_OK;
+}
+
DECL_STMT_FUNC(scan1, m_bool, Env)
ANN static inline m_bool scan1_stmt(const Env env, const Stmt stmt) {
#define scan2_stmt_continue (void*)dummy_func
#define scan2_stmt_break (void*)dummy_func
#define scan2_stmt_return scan2_stmt_exp
-#define scan2_stmt_pp dummy_func
+
+ANN static m_bool scan2_stmt_pp(const Env env, const Stmt_PP stmt) {
+ if(stmt->pp_type == ae_pp_include)
+ env->name = stmt->data;
+ return GW_OK;
+}
DECL_STMT_FUNC(scan2, m_bool, Env)