rewrite_amp_pipe_to_band_bor

Function rewrite_amp_pipe_to_band_bor 

Source
pub(super) fn rewrite_amp_pipe_to_band_bor(s: &str) -> String
Expand description

Rewrite a & b to band(a, b) and a | b to bor(a, b), leaving &&, ||, &=, |= untouched. MD2 expression syntax treats single & / | as numeric short-circuit AND/OR (returning 0.0/1.0), not as bitwise ops, so we map them onto our registered band/bor builtins which already preserve those semantics. Operates iteratively: each pass rewrites one operator from the left, then the next scan picks up any nested &/| that the previous edit’s right operand contained.