Adding basic native enums validation
This commit is contained in:
parent
2450fd0060
commit
12470844f3
|
@ -572,7 +572,12 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
|
|||
|
||||
{%- for fname,v in o.values ~%}
|
||||
{
|
||||
en.Define(new EnumItemSymbol(new Origin(), "{{fname}}" ,(int){{v}}));
|
||||
#if !BHL_FRONT
|
||||
if(Enum.GetName(en.GetNativeType(), {{v}}) != "{{fname}}")
|
||||
throw new Exception("Enum '{{o.name}}' names don't match at value " + {{v}});
|
||||
#endif
|
||||
|
||||
en.Define(new EnumItemSymbol(new Origin(), "{{fname}}", (int){{v}}));
|
||||
}
|
||||
{%~ endfor -%}
|
||||
|
||||
|
|
Loading…
Reference in New Issue