full-moon
full-moon copied to clipboard
Add initial support for Pluto
This adds --features pluto, relevant methods on LuaVersion, and implements parsing for many of the syntax additions:
- Compound operators
- Member access safe navigation
- Continue statement
- Numeral parsing
- Universal block opener
- Operator aliases
- Counted break statement
- Unicode identifiers
- Coalescing operator
- If expressions
- Walrus operator
I would like for this to be a complete PR, but the language has far too many syntax additions for that. Features that are not implemented here yet include:
- Destructuring (
local { a } = { a = 1 }andlocal [ a ] = { 1 }) - Ternary expressions (
a ? b : c) - Type hinting (roughly a subset of Luau's from what I can tell)
- Lambda syntax (
|a| -> tostring(a)and|| -> do print("hi") end) - Pluto's string interpolation (e.g.
$"1 + 2 = {1 + 2}")
I think at this point the PR is good for review so I at least know if this is the right direction and if I understood the project structure correctly. I'd be happy to keep making subsequent PRs to move progress forwards on this.