From 9180aa8b5d7e51ffa479a921ae7306a7c943b0cb Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Wed, 26 Jul 2023 13:27:15 +0300 Subject: [PATCH] Removing @optional support --- src/codegen.inc.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 0bea2fb..9d84729 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -23,10 +23,7 @@ function supported_tokens() { return [ 'default', - 'optional', 'virtual', - //TODO: anyone uses it? - 'is_enum_mask', ]; } @@ -223,8 +220,7 @@ function data2value($name, \mtgType $type, $buf, $prefix = '', $tokens = array() else if($type instanceof \mtgMetaEnum) { $str .= $cond_indent."{$tmp_val} = " . apply_value_filters($name, $tokens, "{$tmp_val}"). ";\n"; - $check_enum_validity = array_key_exists('is_enum_mask', $tokens) ? 'false' : 'true'; - $str .= $cond_indent."{$pname} = \metagen_php\\val_enum('$type', {$tmp_val}, {$check_enum_validity});\n"; + $str .= $cond_indent."{$pname} = \metagen_php\\val_enum('$type', {$tmp_val}, false);\n"; } else throw new Exception("Unknown type '{$type}'");