The parser has two rules which join two lists. Let's add a helper
to do that instead of duplicating the code for list concatenation.
Furthermore, in both cases one of the lists is known to be nonempty;
the implementation can be slightly simplified with that assumption.