dfajit 0.1.1

JIT compilation of DFA transition tables to native x86_64 jump tables
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use dfajit::JitDfa;
use matchkit::Match;

fn main() {
    let jit = JitDfa::from_regex_patterns(&["a+"]).unwrap();
    let mut matches = vec![Match::from_parts(0, 0, 0); 20];
    let count = jit.scan(b"aaab", &mut matches);
    println!("count = {}", count);
    for i in 0..count.min(matches.len()) {
        let m = matches[i];
        println!(
            "match {}: pid={} start={} end={}",
            i, m.pattern_id, m.start, m.end
        );
    }
}