On Fri, 21 Apr 2017 05:44:48 -0700, consult...@jnthn.net wrote: > This is golfed from a File::Ignore regression. This reproduces it: > > grammar Parser { > token TOP { <matcher>+ } > proto token matcher { * } > token matcher:sym<[]> { '[' <( <-[\]]>+ )> ']' } > token matcher:sym<lit> { <-[/*?[]>+ } > } > class RuleCompiler { > # Simply commenting out this causes the matcher:sym<lit> to get the > .txt it should. With > # this, it gets ].txt instead. > method matcher:sym<[]>($/) { } > } > say Parser.parse('[AB].txt', :actions(RuleCompiler)); > > Commenting out the action method makes the final match tree correct. > Without it, the match tree ends up with the second matcher wrongly > capturing the ]. > > I've had trouble bisecting it due to unbuildable commits; the log is here: > > https://gist.github.com/Whateverable/119eb26d8ca245bf59ec05bc014c9fc2 > > It was fine in 2017.03 and broken in 2017.04, perhaps around the time of > the uncurse merge. I'm somewhat suspecting that, since it unified Match and > Cursor. This code may be a tricky edge case for the unification since it > uses the <( and )> constructs, which make the captured text and the text > matched by the cursor differ.
Fixed by TimToady++ and test added in S05-metasyntax/angle-brackets.t.