From 29fa6022a6f5b828b361e87bd520bc54a6532aa5 Mon Sep 17 00:00:00 2001 From: Madpwnhammer Date: Fri, 2 Dec 2022 19:11:48 +0300 Subject: [PATCH] Codegen fixes --- tpl/macro.twig | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tpl/macro.twig b/tpl/macro.twig index 1523834..6c81209 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -119,7 +119,7 @@ stack, Script_{{o.name|norm_name}}.Method_{{m.name}}.ReadArgs(frm, args_info) ); - return null + return null; } #else null @@ -143,7 +143,7 @@ stack, Script_{{o.name|norm_name}}.Method_{{m.name}}.ReadArgs(frm, args_info) ); - return null + return null; } #else null @@ -207,7 +207,7 @@ {% endif %} {% endfor %} - {{ _self.read_args2natives(o, 'args.', this_type) }} + {{ _self.read_args2natives(o, 'args.', this_type, false) }} return args; } {%- endmacro -%} @@ -249,8 +249,11 @@ {%- endfor ~%} {%- endmacro -%} -{%- macro read_args2natives(o, arg_prefix, this_type = null) -%} +{%- macro read_args2natives(o, arg_prefix, this_type = null, declare_locals = true) -%} + + {%- if declare_locals -%} {{ _self.local_native_vars(o.args, arg_prefix) }} + {%- endif -%} {# traversing args in reverse order #} {%- set default_counter = 0 -%} @@ -349,7 +352,7 @@ for(int i=0;i