glua_parser 0.1.5

Parser for Garry's Mod Lua, Lua 5.x, and LuaJIT source files.
Documentation
  • Coverage
  • 0.49%
    4 out of 809 items documented0 out of 1 items with examples
  • Size
  • Source code size: 813.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 107.23 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 8s Average build duration of successful builds.
  • all releases: 1m 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Pollux12/gmod-glua-ls
    3 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Pollux12

GLua-Parser

GLua-Parser is a parser for Lua5.1, Lua5.2, Lua5.3, Lua5.4, and LuaJIT and also supports GLua 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 GLua 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);
}

Based on EmmyLua Analyzer Rust.