stadelmanma / tree-sitter-fortran

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

Fix `variable_modification` clash with `assignment_statement ` #114

Open ZedThree opened 22 hours ago

ZedThree commented 22 hours ago

Fixes #103

This is a proper fix for #103, not sure why I didn't think of this before!

Again, this includes earlier PRs to make merging easier.

I've now acquired a much larger corpus, some 30M lines of .f90 and .f files. It took 8 minutes on 8 cores to query them all for uses of variable attributes as identifiers, and the full list is:

      2 text: `automatic`
      2 text: `external`
      2 text: `sequence`
      4 text: `private`
      6 text: `intrinsic`
      7 text: `shared`
      9 text: `dimension`
     13 text: `static`
     16 text: `contiguous`
     19 text: `public`
     22 text: `constant`
     38 text: `texture`
     51 text: `save`
     53 text: `optional`
     77 text: `kind`
    179 text: `pointer`
    218 text: `allocatable`
    227 text: `target`
    253 text: `device`
    271 text: `parameter`
    945 text: `len`
   3521 text: `value`

value was already covered and not a problem!