From a0461bf3a3d4c6dc0ab425b8e267b83928d10979 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 8 Dec 2022 19:30:54 +0300 Subject: [PATCH] Fixing typos --- src/codegen.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 03416b3..17f0ac1 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -82,7 +82,7 @@ function _add_twig_support(\Twig\Environment $twig) } )); $twig->addFunction(new \Twig\TwigFunction('get_all_fields', - function($meta, $o) + function($o) { return \mtg_get_all_fields($o); } @@ -253,13 +253,13 @@ function field_reset($name, \mtgType $type, array $tokens) } else if($type instanceof \mtgArrType) { - $str = "if self.$name == nil { \nself.$name = make(".go_type($field->getType(), $field->getTokens()).",0) \n}\n "; + $str = "if self.$name == nil { \nself.$name = make(".go_type($type, $tokens).",0) \n}\n "; $str .= "self.$name = self.{$name}[0:0]"; } else if($type instanceof \mtgMetaEnum) { if(array_key_exists('default', $tokens)) - $str = "self.$name = ".go_type($field->getType(), $field->getTokens())."_".trim($tokens['default'], '"'); + $str = "self.$name = ".go_type($type, $tokens)."_".trim($tokens['default'], '"'); else $str = "self.$name = 0"; } @@ -267,7 +267,7 @@ function field_reset($name, \mtgType $type, array $tokens) { $is_virtual = array_key_exists("virtual", $tokens); if($is_virtual) - $str .= "self.$name = New".ltrim(go_type($field->getType(), $field->getTokens()),'I')."() "; + $str .= "self.$name = New".ltrim(go_type($type, $tokens),'I')."() "; else $str .= "self.$name.Reset()"; }