diff --git a/tpl/macro.twig b/tpl/macro.twig index ab3e5a2..915d1b9 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -139,17 +139,27 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack { var fn = new FuncSymbolNative("{{m.name|norm_name}}", + FuncAttrib.None {% if has_token(m, 'bhl_static') ~%} - FuncAttrib.Static, + | FuncAttrib.Static {% endif ~%} + {%- if has_token(m, 'bhl_coroutine') -%} + | FuncAttrib.Coro + {%- endif ~%}, {{ m.returntype|bhl_type_ref }}, {{ count_default_args(m) }}, #if !BHL_FRONT delegate(VM.Frame frm, ValStack stack, FuncArgsInfo args_info, ref BHS status) { + {% if has_token(m, 'bhl_coroutine') -%} + var coro = CoroutinePool.New(frm.vm); + coro.Init(frm, stack, args_info); + return coro; + {%- else ~%} var args = Script_{{o.name|norm_name}}.Method_{{m.name}}.ReadArgs(frm, stack, args_info); Script_{{o.name|norm_name}}.Method_{{m.name}}.Exec(frm, args {{_self.out_results(m)}}); {{_self.return_method_out_results(o, m)}} return null; + {%- endif ~%} } #else null