mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Deprecate MyEnum.elements.
This commit is contained in:
@@ -24,11 +24,9 @@ struct SliceRaw
|
||||
|
||||
macro @enum_lookup($Type, #value, value)
|
||||
{
|
||||
var $elements = $Type.elements;
|
||||
$for var $i = 0; $i < $elements; $i++:
|
||||
var $val = $Type.from_ordinal($i);
|
||||
$foreach $val : $Type.values:
|
||||
if ($val.#value == value) return $val;
|
||||
$endfor
|
||||
$endforeach
|
||||
return NOT_FOUND?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user