strip_unary_plus

Function strip_unary_plus 

Source
pub(crate) fn strip_unary_plus(src: &str) -> String
Expand description

Strip HLSL unary + (a syntactic no-op WGSL doesn’t accept) when it directly follows (, ,, =, +, -, *, /, <, >, ?, : after optional whitespace. Preserves byte positions of everything except the + itself.

Real preset pattern: ret.x += (+dx.x - dy.x)*0.4; — the + after ( is a stylistic flourish. WGSL parser rejects with expected expression, found "+".