So Doctrine annotations are based on JSON but as PHP arrays allow for dangling commas Drupal people are much used to this and to be honest, it's much easier to edit
(
"foo" => "bar",
"foo1" => "bar1",
)
so that the rows can be switched, another row added etc than if that comma after bar1 were missing.
So I am trying to patch Doctrine to allow for this. The maintainer claims
you are mixing grammar rules by checking a token that is not part of "Values", but its parent, "Annotation".
And he is right. So, we are looking for a better grammar.
Annotation ::= "@" AnnotationName ["(" [Values] ")"]
Values ::= Array | Value {"," Value}*
How would you allow for a trailing comma in Values?