The RepUnboundedParser currently creates two marks: startState and priorState. The priorState mark changes as we go through each repetition of the array. The startState mark never changes. If an error occurs during a repetition and a discriminator IS NOT set, we reset to the prior mark, effectively backtracking the single failed repetition and keep all successful repetitions of the array. However, if an error occurs during a repetition and a discriminator IS set, then we backtrack the entire array back to the startState mark.
This behavior is not correct. This behavior treats the beginning of an array as if it were a point of uncertainty, but that is not the case. Only each element of the array is a point of uncertainty. So there is no need for the startState mark. It should be removed, and if a repetition fails and a discriminator is set then we should simply discard priorState mark and backtrack to whatever point of uncertainty enclosed the array (i.e. just return from the parse call and let containing parsers handle it).
We should also examine the other repetition parsers and ensure they have the correct behavior.