stadelmanma / tree-sitter-fortran

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

Support implied do loop construct #3

Closed stadelmanma closed 1 year ago

stadelmanma commented 6 years ago

This seems to be tricky, causing a conflict with the complex literal rule and not being parsed correctly when I fix the conflict. It is a useful construct so I'll circle back around to figuring it out down the road after I hit some other big ticket items. I may run into similar complexities with FORALL statements.

Proposed rule:

    implied_do_loop_expression: $ => seq(
      '(',
      commaSep1($._expression),
      ',',
      $.loop_control,
      ')'
    ),

Docs on implied loops: https://pages.mtu.edu/~shene/COURSES/cs201/NOTES/chap08/io.html

stadelmanma commented 6 years ago

Initial work done in support-implied-do-loops branch but I don't have it working yet.

stadelmanma commented 5 years ago

When I do implement this I'll also want to support array constructors.

stadelmanma commented 3 years ago

@oponkork this is another feature I wasn't able to get figured out, please feel free to take a crack at it. Fortran is quite liberal with the range of stuff allowed in these constructs and I think that is what had me stuck before. I haven't tried to get it working since 2019.