Closed xsawyerx closed 4 years ago
This is caused because the rule for OpListKeywordExpr
(which includes keywords like open
, chmod
, splice
) appears before the ExprAssign
so they can't be matched.
I tried different ways of repeating this rule in the table after the ExprAssign
. I was able to get these tests to work, but then stuff like while ( my ( $foo, $bar ) = splice @foo, 0, 2 ) {1}
would get 3 different types of parsing outputs. :/
Right, we need to somehow allow OpListKeywordExpr
as an RHS for assignment. This creates a loop in our precedence rules (ExprKwList -> ExprComma -> ExprKwAssign -> ExprAssign -> OpListKeywordExpr -> OpKwList
), which creates an ambiguity: ($x = kw $y, $z)
can be parsed as either (($x = kw $y), $z)
or ($x = (kw ($y, $z)))
.
I don't know the solution to this yet.