Open leonerd opened 2 years ago
This should be trivial to implement, so I'll handle it
I imagine the solution would involve creating a new private $_for
that simply matches either "for"
or "foreach"
then rewrite the rest of the rules in terms of that.
Does for
need special casing syntax-wise b/c of the lexical assignment part? Otherwise I would imagine we should group all control-flow blocks in the same syntax group
(copied from https://github.com/ganezdragon/tree-sitter-perl/issues/13)
This grammar makes several distinctions between
for
andforeach
. The real perl parser considers them as exact synonyms of each other. Any and all syntax forms that are accepted by one are accepted by the other. Yes; even C-stylefor
loops: