Quick Enums for Haxe
Shorthand to represent string-enums. Useful for externs.
Usage
var sizes:enums.Enums<'small', 'medium', 'large'>;
Will generate this:
var sizes:Enum1;
@:enum abstract Enum1(String) {
var Small = 'small';
var Medium = 'medium';
var Large = 'large';
}
Note
When generating the identifiers:
- Dashes
-and spaceswill be replaced by an underscore_ - If the string starts with a number, the identifier will be prefixed with an underscore
_