emit_ternary_aware

Function emit_ternary_aware 

Source
fn emit_ternary_aware(e: &Expr, src: &str) -> String
Expand 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).