Small script that rewrites Haxe expressions with primitive pattern matching (inspired by gofmt).
Pattern:
if (#1) #2 else #3 ==> #1 ? #2 : #3
(note that "==>" is a magic syntax that separates the pattern from the replacement expression)
Input:
if (a) b else c
transforms into
a ? b : c