body_has_nested_loop

Function body_has_nested_loop 

Source
fn body_has_nested_loop(s: &str) -> bool
Expand description

true if s contains an EEL2 control-flow builtin name (loop, while, exec2, exec3) as an identifier. Used as a cheap conservative guard before the pre-compile-the-body optimisation in the loop(N, body) interceptor: when the body has a nested loop/while/exec, replaying it as a single Node would bypass the interceptor’s recursive descent and break those semantics, so we fall back to the slow path.

The check is byte-level and ignores word boundaries on purpose — loops_var or while_count would also match and trigger fallback. That’s safe (over-conservative) and avoids a more expensive scan.