Community
Participate
Working Groups
The following code snippet compiles without error: private static Exp COMPLEXEXTENSION_CHILDREN = sFac.concat( sFac.optional("annotation"), sFac.concat( sFac.optional( sFac.union(new String[] {"group","all","choice","sequence"})), sFac.concat( sFac.star( sFac.union(new String[] {"attribute","attributeGroup"})), sFac.optional("anyAttribute")))); //Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?)) private static Exp SIMPLEEXTENSION_CHILDREN = sFac.concat( sFac.optional("annotation"), sFac.concat( sFac.optional( sFac.union(new String[] {"group","all","choice","sequence"})), sFac.concat( sFac.star( sFac.union(new String[] {"attribute","attributeGroup"})), sFac.optional("anyAttribute")))); When the following line is added: private static Exp GROUP_CHILDREN = (an incomplete declaration) the compiler erroneously marks each first instance of a comma in the String initializers preceding it as an error, with the error message: Syntax error: ",",...expected The character marked _is_ a ","! To be perfectly clear, an error after these declarations is incorrectly causing bogus errors to be flagged within the declarations, before the actual error. The resulting blizzard of error flags makes it very difficult to work. BTW, change the above line to, e.g.: private static Exp GROUP_CHILDREN = Exp.Epsilon; And all the bogus errors preceding it go away.
It is confusing indeed, we have a few other instances where syntax error messages could be improved. Post 2.1
We are considering improving our syntax error messages
Fixed.
Verified.