46 releases (25 breaking)
Uses new Rust 2024
| new 0.26.0 | May 9, 2026 |
|---|---|
| 0.24.0 | Mar 6, 2026 |
| 0.21.0 | Dec 25, 2025 |
| 0.19.0 | Nov 7, 2025 |
| 0.5.0 | Nov 12, 2024 |
#26 in Parser tooling
3,384 downloads per month
Used in 10 crates
(7 directly)
795KB
21K
SLoC
EmmyLua-Parser
EmmyLua-Parser is a parser for Lua5.1, Lua5.2, Lua5.3, Lua5.4, and LuaJIT and also supports EmmyLua/LuaCats annotations. Its purpose is to generate AST and CST from the parsed code for further analysis.
Internationalization (i18n) Support
This crate supports multiple languages, defaulting to English (en-US). Users can optionally initialize i18n to set a different language.
Features
- Lossless syntax tree generation
- Easy-to-use API based on the
rowanlibrary - Support for Lua5.1, Lua5.2, Lua5.3, Lua5.4, Lua5.5 and LuaJIT
- Support for EmmyLua/LuaCats annotations
- Ability to parse code with syntax errors
Usage
let code = r#"
local a = 1
local b = 2
print(a + b)
"#;
let tree = LuaParser::parse(code, ParserConfig::default());
let chunk = tree.get_chunk_node();
for node in chunk.descendants::<LuaAst>() {
println!("{:?}", node);
}
Dependencies
~7–11MB
~211K SLoC