stadelmanma / tree-sitter-fortran

Fortran grammar for tree-sitter
MIT License
30 stars 15 forks source link

Array literals don't match correctly #2

Closed stadelmanma closed 6 years ago

stadelmanma commented 6 years ago

For some reason the rule doesn't seem to be working the way I expect it to since it will match a single entry in the array but not multiple ones.

Grammar rule:

// rule should match 1 or more comma separated expressions 
// (i.e. literals, function calls, etc.)
array_literal: $ => seq('(', '/', commaSep1($._expression), '/', ')'),

Test source code:

y = (/ INT(1) /)  ! matches
l(1:3) = (/1, INT(r/i), i/)  ! doesn't match
stadelmanma commented 6 years ago

I wonder if a prec.right will fix this.