Skip to content

Conversation

ZedThree
Copy link

Replaces #1

Updated to tree-sitter 0.23 and the latest (0.2.0) tree-sitter-fortran grammar.

Parses 100% of LAPACK.

It's a bit harder to check the wider corpus as lots of projects compile .f files in free-form mode, and so aren't valid fixed-form. There's also a surprising number of fixed-form files with tabs out there too, which obviously makes parsing them tricky when we're looking for any character in column 6 for a line continuation.

I've tried a couple of things for handling tabs, but not managed to get one to work. I think probably a sensible approach would be to basically not try to handle line continuations if we've seen a tab already on a given line.

@stadelmanma I've been having to do some manual futzing in order to update against the free-form grammar. Basically npm update doesn't seem to work locally for me, and I have to run node-gyp build in tree-sitter-fortran manually and copy some files across to node_modules in this project. This might be easier if we can publish the npm package for tree-sitter-fortran?

@ZedThree
Copy link
Author

Hmm, I've copied the github workflows across, but they don't seem to have been picked up

@ZedThree
Copy link
Author

@stadelmanma I sorted out my issues with npm update/install, and this now all seems to work fine.

This is now updated to the latest tree-sitter-fortran (0.5.1). It's slightly annoying to keep the external scanners in sync, I'm not sure there's a better way of doing that. While some bits can be reused, obviously line continuations have to be handled differently, and there's two or three places they creep in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant