mod program;
pub use program::{rust_lexer, rust_lexer_batch};
use vyre::ir::Program;
pub struct RustLexerPlan;
impl RustLexerPlan {
pub fn new() -> Self {
Self
}
#[must_use]
pub fn build(&self) -> Program {
self.build_for_len(0)
}
#[must_use]
pub fn build_for_len(&self, haystack_len: u32) -> Program {
rust_lexer(
"haystack",
"out_tok_types",
"out_tok_starts",
"out_tok_lens",
"out_counts",
haystack_len,
)
}
#[must_use]
pub fn build_batch_for_layout(
&self,
haystack_len: u32,
source_count: u32,
token_stride: u32,
) -> Program {
rust_lexer_batch(
"haystack",
"source_offsets",
"source_lens",
"out_tok_types",
"out_tok_starts",
"out_tok_lens",
"out_counts",
haystack_len,
source_count,
token_stride,
)
}
}
impl Default for RustLexerPlan {
fn default() -> Self {
Self::new()
}
}