Removing @optional support

This commit is contained in:
Pavel Shevaev 2023-07-26 13:27:15 +03:00
parent 2fc83c97b0
commit 9180aa8b5d
1 changed files with 1 additions and 5 deletions

View File

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