Parser: Unify optional rule handling

Use the "opt" function for the "statements" grammar rule by folding the
result to a list. This unifies optional rule handling in the grammar.

Signed-off-by: Pekka Enberg <penberg@iki.fi>