Loretta
A C# (G)Lua lexer, parser, code analysis, transformation and code generation toolkit. For getting started, see the tutorial.
This is (another) rewrite from scratch based on Roslyn and The Complete Syntax of Lua with a few extensions:
- Operators introduced in Garry's Mod Lua (glua):
&&
forand
;||
foror
;!=
for~=
;!
fornot
;
- Comment types introduced in Garry's Mod Lua (glua):
- C style single line comment:
// ...
; - C style multi line comment:
/* */
;
- C style single line comment:
- Characters accepted as part of identifiers by LuaJIT (emojis, non-rendering characters, or basically any byte above
127
/0x7F
); - Luau (Roblox Lua) syntax (partial):
- Compound assignment:
+=
,-=
,*=
,/=
,^=
,%=
,..=
; - If expressions:
if a then b else c
andif a then b elseif c then d else e
; - Typed lua syntax.
- Compound assignment:
- FiveM's hash string syntax (only parsing, manual node creation currently not possible);
- Continue support. The following options are available:
- No continue at all;
- Roblox's
continue
which is a contextual keyword; - Garry's Mod's
continue
which is a full fledged keyword.
TL;DR: This supports Lua 5.1, Lua 5.2, Lua 5.3, Lua 5.4, LuaJIT 2.0, LuaJIT 2.1, FiveM, GLua and (partially) Luau (Roblox Lua).