ganezdragon / tree-sitter-perl

a perl parser for javascript
MIT License
33 stars 9 forks source link

`for` and `foreach` should be exact aliases of each other #13

Closed leonerd closed 1 year ago

leonerd commented 2 years ago

This grammar makes several distinctions between for and foreach. 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-style for loops:

$ perl -E 'foreach(my $i = 0; $i < 3; $i++) { say $i }'
0
1
2

(I can send a PR to fix this)

Leeft commented 1 year ago

This is integrated with #27 so this issue can be closed