Flattened concatenation parse trees

This avoids the empty arrays at the end of concatenations (and therefore repetitions).