rusty
rusty copied to clipboard
Resolving local inline enum variants requires linear search and substring-comparisons
Resolving inline enum variants is unnecessarily complex since they are unfavorably stored in the index.
FUNCTION main : DINT
VAR
variant1 : (x := 1, y := 2) := x;
END_VAR
END_FUNCTION
We should pre-process this code into:
TYPE __main_enum_1 : (x := 1 ,y := 2) INT
END_TYPE
FUNCTION main : DINT
VAR
variant1 : __main_enum_1 := __main_enum_1#x;
END_VAR
END_FUNCTION
This way, we can resolve inline enums the same way.