Getting rid of 'bhl_async' support, use 'bhl_coroutine' instead

This commit is contained in:
Pavel Shevaev 2022-12-30 20:50:47 +03:00
parent 64aa9347c8
commit ff32cb639f
2 changed files with 3 additions and 4 deletions

View File

@ -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]}\")";

View File

@ -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-%}