rewrite_arity_mismatched_semis

Function rewrite_arity_mismatched_semis 

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

Arity-aware companion of rewrite_semis_in_call_args. Walks every function-call paren group and, for builtins with a known fixed arity, converts top-level ; separators inside the arg list to , when doing so unambiguously yields the expected arg count.

Fires only on calls where comma_count + semi_count + 1 == arity. The simpler “no commas, all semis” case is already handled by rewrite_semis_in_call_args; this pass catches the mixed milkif(cond, a; b) / clamp(x, lo; hi) shapes the conservative pass leaves alone. Calls in the loop/exec*/while skip-set are also bypassed here.