stadelmanma / tree-sitter-fortran

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

New upstream feature #93

Open amaanq opened 1 year ago

amaanq commented 1 year ago

Not a bug, but I've added functionality upstream to allow for the case-insensitive regex flag, so /foo/i would work now. Hope it might help here.

ZedThree commented 4 months ago

I've had a stab at switching to this, and although it does make the grammar easier to read, it introduces some errors, mostly around disambiguating plain identifiers and Fortran's unreserved keywords. Unfortunately, these do crop up in the real world.

See my branch for implementation, and this test file for some regressions.

One issue I realised is that we can't simply replace, for example, whiteSpacedKeyword('else', 'if') with just /end *if/i because it's possible to put a continuation line in between the keywords, but this is an orthogonal issue.