| Crates.io | emmylua_parser |
| lib.rs | emmylua_parser |
| version | 0.16.0 |
| created_at | 2024-10-23 08:54:23.245226+00 |
| updated_at | 2025-09-19 11:18:48.099548+00 |
| description | A parser for EmmyLua and luals |
| homepage | |
| repository | https://github.com/CppCXY/emmylua-analyzer-rust |
| max_upload_size | |
| id | 1419847 |
| size | 745,812 |
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.
This crate supports multiple languages, defaulting to English (en-US). Users can optionally initialize i18n to set a different language.
rowan librarylet 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);
}