luars 0.17.0

A library for lua 5.5 runtime implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// High-performance Lua pattern matching — byte-oriented, zero-AST design
//
// Modeled after C Lua's lstrlib.c. Operates on `&[u8]` (raw bytes).
// In Lua, all string operations are byte-oriented — each byte is a "character".
//
// 1. NO AST / parse phase — pattern string is interpreted directly during matching
// 2. Fixed-size capture array (32 slots) — no heap allocation during matching
// 3. MatchState struct tracks all state on the stack
// 4. Pattern is `&[u8]`, walked with index arithmetic (like C pointers)
// 5. Recursion-limited to prevent stack overflow on pathological patterns

mod class;
mod engine;

pub use engine::{
    CaptureValue, find, find_all_matches, find_assume_valid, gsub, is_plain_pattern, validate,
};