Skip to main content

load_packed_byte_expr

Function load_packed_byte_expr 

Source
pub fn load_packed_byte_expr(haystack: &str, idx: Expr) -> Expr
Expand description

LEGO BLOCK: Pure-expression form of load_packed_byte.

Inlines the word load directly into the shift+mask, returning a single Expr with no Node::Let side effect. Use this when the byte is consumed in a single expression context (e.g. an If condition or Node::ne predicate inside a Loop body) where hoisting a let-bind would either inject it at the wrong scope or require restructuring the surrounding IR.

Trade-off: no CSE handle for the word load - if the same byte position is referenced more than once, prefer load_packed_byte and bind the result. Single-use call sites (the cursor body in nfa::nfa_scan_with_plan and the literal-compare inside literal_set::literal_set_program) take this form because they reference the byte exactly once per iteration.