stevehalliwell / ulox

A bytecode interpreted scripting language for games in Unity.
MIT License
23 stars 0 forks source link

Desugar step #223

Closed stevehalliwell closed 7 months ago

stevehalliwell commented 7 months ago

Presently we deal with things like auto init assigns and for/loop sugar in the compiler directly.

Consider if we should instead run a desugaring step/converter ahead of the compiler. The intent being that the compiler itself has to do less work and know less. It would only know about the desugared version of the language.

This might also open up options for things that presently use an opcode and special vm behaviour out and desugar them to more common.

Note: potentially this could take over the string interp logic as a starting point.