luaparse

Crates.ioluaparse
lib.rsluaparse
version0.2.0
sourcesrc
created_at2020-05-30 16:19:25.78562
updated_at2020-06-14 17:11:20.926984
descriptionA Lua 5.3 parser
homepage
repositoryhttps://gitlab.com/cc-ru/luaparse-rs
max_upload_size
id247729
size168,672
(LeshaInc)

documentation

https://docs.rs/luaparse

README

luaparse

A Lua 5.3 parser. Preserves insignificant tokens (whitespace and comments) in the syntax tree.

Documentation.

Example

use luaparse::error::Error;
use luaparse::{parse, HasSpan};

let buf = r#"
local a = 42
local b = 24

for i = 1, 100, 1 do
  b = a - b + i
end

print(b)
"#;

match parse(buf) {
    Ok(block) => println!("{}", block),
    Err(e) => eprintln!("{:#}", Error::new(e.span(), e).with_buffer(buf)),
}
Commit count: 144

cargo fmt