Merges adjacent sequences and alternations, i.e. it
transforms #<SEQ #<STR a> #<SEQ #<STR b> #<STR c>>> to
#<SEQ #<STR a> #<STR b> #<STR c>>. This is a destructive
operation on REGEX.
flatten < alternation > |
flatten < branch > |
flatten < regex > |
flatten < seq > |