Oh boy this is gonna be something, it’ll be fun though.
Major problem is analysis - lexical analysis is a tough nut to crack, especially with a language that relies on syntactic sugar as much as this one does. Minecraft doesn’t support many operations natively, so EVERYTHING has to be simplified in weird ways which creates a ton of things I have to end up doing in my analyzer. :/
The attached screenshot is my WIP type inference analyzer, and it is a freaking chonker. There’s a lot of little things to consider - #[repr] metadata, struct layout, types, all of that goes into figuring out what a type even is for a value.
I decided to end up typing the values in-AST by using the &mut reference passed into the visitor (replacing the original node in memory), but I might change the approach later.
I’m also not sure if doing inference before desugaring is a good idea, but only one way to find out, I guess.