luau-analyzer-sys
High-level ergonomic Rust bindings and low-level C++ FFI bindings for the native Luau static type analyzer and compiler frontend.
Overview
luau-analyzer-sys provides a bridge between Rust and Luau's C++ static type checking engine (Luau::Frontend). It abstracts away internal type resolution scopes, AST traversal checks, and linting routines into a safe, easy-to-use Rust interface (NativeAnalyzer).
Key Features
- Embedded Type Analysis: Perform zero-overhead static checking of Luau codebases directly from Rust.
- Custom Definitions: Inject global environment mapping definitions dynamically via Luau
.d.luaufiles. - Dependency Resolution: Fully recursive module path resolution via safe Rust closures.
- Granular Diagnostics: Capture detailed warnings, errors, and lint output complete with source span offsets.
- Deprecation Linting: Native static interception of deprecated functions (e.g.
getfenv) mapped via dynamic line deduplication.
Usage
Add luau-analyzer-sys as a dependency in your Cargo.toml:
[]
= { = "../luau-analyzer-sys" }
Example: Checking a Luau Module
use NativeAnalyzer;
License
This project is licensed under the MIT License - see the LICENSE file for details.