Better support for interface callbacks
This commit is contained in:
parent
9d9eee1ab3
commit
4be8ded046
|
@ -1,6 +1,16 @@
|
|||
{%- macro reg_func_native(o, scope = 'types.ns', this_prefix = '') ~%}
|
||||
{
|
||||
var fn = new FuncSymbolNative(new Origin(), "{{o.name|ns_last}}",
|
||||
var fn =
|
||||
{{ _self.func_native(o, this_prefix) }}
|
||||
;
|
||||
|
||||
{{scope}}.{{o.name|ns_prefix}}Define(fn);
|
||||
}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro func_native(o, this_prefix = '') ~%}
|
||||
|
||||
new FuncSymbolNative(new Origin(), "{{o.name|ns_last}}",
|
||||
|
||||
{%- if has_token(o, 'bhl_coroutine') -%}
|
||||
FuncAttrib.Coro,
|
||||
|
@ -38,10 +48,7 @@
|
|||
{% if o.args %},{% endif %}
|
||||
|
||||
{{ _self.func_decl_args(o) }}
|
||||
);
|
||||
|
||||
{{scope}}.{{o.name|ns_prefix}}Define(fn);
|
||||
}
|
||||
)
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro reg_func_partial(o, scope = 'types.ns') ~%}
|
||||
|
@ -698,8 +705,7 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
|
|||
var ifs = new InterfaceSymbolNative(new Origin(), "{{o.name|ns_last}}", null
|
||||
|
||||
{% for m in o.getfuncs %}
|
||||
, new FuncSymbolNative(new Origin(), "{{m.name}}", {{m.returntype|bhl_type_ref}}, 0, null)
|
||||
|
||||
, {{ _self.func_native(m, '(('~o.name~')stack.PopRelease()._obj).') }}
|
||||
{% endfor %}
|
||||
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue