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

Download history 1066/week @ 2026-01-17 629/week @ 2026-01-24 219/week @ 2026-01-31 508/week @ 2026-02-07 162/week @ 2026-02-14 355/week @ 2026-02-21 189/week @ 2026-02-28 414/week @ 2026-03-07 438/week @ 2026-03-14 493/week @ 2026-03-21 817/week @ 2026-03-28 743/week @ 2026-04-04 917/week @ 2026-04-11 818/week @ 2026-04-18 941/week @ 2026-04-25 609/week @ 2026-05-02

3,384 downloads per month
Used in 10 crates (7 directly)

MIT license

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 rowan library
  • 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