fn emit_ternary_aware(e: &Expr, src: &str) -> StringExpand description
Render an expression to text, replacing any ternaries in its subtree
with select(...). Non-ternary nodes that contain ternaries get
rebuilt from the AST so the ternary substitution can flow up; pure
non-ternary subtrees fall back to the original source slice (which
preserves whitespace, comments and HLSL idioms that downstream regex
passes still need to see verbatim).