Enumerations (ACS) - DavidPH/GDCC GitHub Wiki

GDCC provides enumerations as an extension to ACS, with a nearly identical syntax to C. Enumerations allow naming integer constants and are particularly useful for sequential constants.

Values are assigned sequentially by default starting from zero. An explicit value can also be assigned.

// The enum name is optional.
enum Fruits
    APPLE, // First constant is 0 by default.
    ORANGE, // Second is 1, and so on.
    MELON = 4, // An explicit value can be assigned.
    STRAWBERRY, // This constant is 5, following the usual sequential assignment.
    PINEAPPLE, // This constant is 6. Trailing commas are also allowed as in C.

// The enum name becomes a type name, usable where int/str/fixed/bool would be.
// This behaves identically to an int.
Fruits FavoriteFruit = MELON;