Crates.io | luau-ast-rs |
lib.rs | luau-ast-rs |
version | 0.1.29 |
source | src |
created_at | 2023-06-20 20:42:22.699659 |
updated_at | 2023-08-02 18:24:38.499076 |
description | A Parser and AST for Luau and Lua5.1 written in Rust |
homepage | |
repository | https://github.com/cassanof/luau-ast-rs |
max_upload_size | |
id | 895484 |
size | 294,822 |
This is a tree-sitter-based parser for Luau and Lua5.1 written in Rust. The grammar used is a fork of polychromatist/tree-sitter-luau.
This crate aims to provide a complete and fast parser for Luau, while also providing pretty-printing and AST traversal utilities.
stacker
crate (see the function parse_expr
in parser.rs
).
The visitors use the same queue and recursion strategy, so they're also very fast.See this project I'm working on: lua-dataset-heuristics, where I use this crate to parse a large dataset of ~500,000 Lua files and score them using a heuristic. This parser is used to parse the files, and then the AST is traversed to find the relevant information. All the files are processed in only a few minutes, which shows how fast this parser is.