Module regex/vm
regex/vm
NFA virtual machine (Thompson simulation).
Executes a compiled NFA program against an input string. Uses Thompson's NFA simulation with parallel state tracking for O(n×m) worst-case time complexity.
Types
NfaVm
object
NfaVm
Fields
| Name | Type | Description |
|---|---|---|
_program | NfaProgram | |
_flags | RegexFlags | |
_input | String | |
_bytes | ArrayList(u8) | |
_n_slots | usize | |
_seen | ArrayList(bool) | |
_next_seen | ArrayList(bool) |
impl(NfaVm, ...)
new : (NfaVm) fn(program : NfaProgram, flags : RegexFlags, input : String) -> NfaVm_decode_codepoint : (NfaVm) fn(self : NfaVm, pos : usize) -> DecodedChar_to_lower : (NfaVm) fn(self : NfaVm, cp : u32) -> u32_is_word_char : (NfaVm) fn(self : NfaVm, cp : u32) -> bool_find_prev_char_start : (NfaVm) fn(self : NfaVm, pos : usize) -> usize_prev_byte_is_newline : (NfaVm) fn(self : NfaVm, pos : usize) -> bool_cur_byte_is_newline : (NfaVm) fn(self : NfaVm, pos : usize) -> boolimpl(NfaVm, ...)
_char_matches : (NfaVm) fn(self : NfaVm, expected : u32, actual : u32) -> bool_codepoint_in_class : (NfaVm) fn(self : NfaVm, cp : u32, cls : ClassEntry) -> bool_is_word_boundary : (NfaVm) fn(self : NfaVm, pos : usize) -> boolimpl(NfaVm, ...)
impl(NfaVm, ...)
_run_sub_vm : (NfaVm) fn(self : NfaVm, sub_start_pc : usize, start_byte : usize, required_end : usize) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | NfaVm | |
sub_start_pc | usize | |
start_byte | usize | |
required_end | usize |
Returns: bool
DecodedChar
struct
DecodedChar
Fields
| Name | Type | Description |
|---|---|---|
codepoint | u32 | |
byte_len | usize |