From ff32cb639f9208c4c63d1448418c230ada1553da Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Fri, 30 Dec 2022 20:50:47 +0300 Subject: [PATCH] Getting rid of 'bhl_async' support, use 'bhl_coroutine' instead --- src/bind.inc.php | 3 +-- tpl/macro.twig | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bind.inc.php b/src/bind.inc.php index e282013..6e045fc 100644 --- a/src/bind.inc.php +++ b/src/bind.inc.php @@ -30,7 +30,6 @@ function supported_tokens() 'bhl_ecs_component_ref', 'bhl_coroutine', 'bhl_static', - 'bhl_async', 'bhl_native_class', 'bhl_native_class_params', 'bhl_native_prefix', @@ -251,7 +250,7 @@ function bhl_type_ref($type_str) { if(preg_match('~\[\]((\w|\.)+)~', $type_str, $ms)) return "types.TArr(\"{$ms[1]}\")"; - else if(preg_match('~async\s+func\s+((\w|\.)+)\s*\(\)~', $type_str, $ms)) + else if(preg_match('~coro\s+func\s+((\w|\.)+)\s*\(\)~', $type_str, $ms)) return "types.TFunc(true, \"{$ms[1]}\")"; else if(preg_match('~func\s+((\w|\.)+)\s*\(\)~', $type_str, $ms)) return "types.TFunc(false, \"{$ms[1]}\")"; diff --git a/tpl/macro.twig b/tpl/macro.twig index bb8bbe0..7a87a44 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -349,8 +349,8 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack {%- for arg in fn.args -%} new FuncArgSymbol("{{arg.name}}", - {%-if has_token(arg, 'bhl_async') -%} - {{('async ' ~ (arg.type|bhl_type))|bhl_type_ref}}, + {%-if has_token(arg, 'bhl_coroutine') -%} + {{('coro ' ~ (arg.type|bhl_type))|bhl_type_ref}}, {%-else-%} {{arg.type|bhl_type_ref}}, {%-endif-%}