Closed resinten closed 6 years ago
Not sure what's the cause, I hope to look into it in the morning.
I'm playing with it right now and it looks to me like it might have something to do with a %left
declaration. I have two associative operators AND
and OR
, which can occur in one of the types of statements that can occur. Without %left
, they have 25 reduce/reduce conflicts, but it does not complain about duplicate indices. Hopefully it's not just me making a silly mistake somewhere :-)
A minimal but self-contained grammar that reproduces the issue seems to be required.
@softero Gentle ping: Please provide an complete example grammar that reproduces the issue, thank you. No real need to minimize it, any .y
file that demonstrates the fail is ok.
Timed out, please reopen when having a repro, thanks.
I have a parser that has the following basic structure:
And I am getting the following error:
y.go:348:12: duplicate index in array literal: 5
I opened upy.go
and lines 345-349 look like this:If I'm not mistaken, it looks like the error corresponds to state 1. But I'm not a yacc expert, by any means. Looking at
y.output
for state 1 gives the following:So, I think I'm reading this correctly as "we just reduced
program
, so check whether the next token is$end
,AND
,ARROW
,LCURLY
, orOR
." I'm not sure why it would be checking that though because there is no valid token other than$end
that can occur after reducing toprogram
, which is making me think this may be an issue withgoyacc
. It appears to work if I manually alter the entry to just{5: 42}
. Thoughts?