We had an issue using participle when using a structure like the following
type Union struct {
Float float64 `( @Float`
String string ` | @String+`
Bool bool ` | @Boolean )`
}
The code works as intended, but when you use a @String+ as a part of your union types your error messages get a lot less helpful. Instead of getting errors like
1:1: unexpected token "102"
most of your errors turn into
1:1: sub-expression + must match at least once
This ends up this way because the group node returns an error when @Foo+ doesn't match the minimum quantity which then overrides any other useful error reporting and failthroughs
This small change makes it so that the error is only reported if there is at least one match in a group (and adds a test to enforce it)
We had an issue using participle when using a structure like the following
The code works as intended, but when you use a
@String+
as a part of your union types your error messages get a lot less helpful. Instead of getting errors likemost of your errors turn into
This ends up this way because the group node returns an error when
@Foo+
doesn't match the minimum quantity which then overrides any other useful error reporting and failthroughsThis small change makes it so that the error is only reported if there is at least one match in a group (and adds a test to enforce it)