WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 10 forks source link

Add `#enum` for header #75

Closed WingedSeal closed 8 months ago

WingedSeal commented 8 months ago
#enum ClassName ITEM_1 ITEM_2 ITEM_3
#enum OtherClass 1 ITEM_1 ITEM_2 ITEM_3

is equivalent to

#define ClassName.ITEM_1 0
#define ClassName.ITEM_2 1
#define ClassName.ITEM_3 2
#define OtherClass.ITEM_1 1
#define OtherClass.ITEM_2 2
#define OtherClass.ITEM_3 3
WingedSeal commented 8 months ago

Implemented in https://github.com/WingedSeal/jmc/commit/e76db39eedbe4c7fb476f2d18a5153259576fb73