-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In fortran fixed format files, comments beginning with other characters than ! (e.g, c, C etc) are not treated as comments #61
Comments
I am having a similar problem. As I am working with LAPACK code, line comments start with It seems like FORTRAN 77 comments are line that start with letter |
Fixed form format isn't perfectly supported. I think some code would need added to the |
I suspect that fixed form will be fundamentally incompatible with free form in the same parser. Any character in column 1 indicates a comment in fixed form, and I don't think there's any way of passing options into the parser. In the C++ parser, for instance, they've squashed all the different standards into one. One option is to use something like fixed2free.py to convert the source to free form, and then use tree-sitter. |
I wonder if we could do Fixed Form Fortran by importing this language into it and customizing the scanner part to deal with columns 1-7? I don’t really know how tree sitter “imports” other languages but you mentioned the CPP parser doing that. I suspect it would be more liberal than an actual fixed form complier but it also wouldn’t require massive code duplication. |
I think that would be the most economical way of doing things. Here's the important bits from the C++ parser: const C = require("tree-sitter-c/grammar")
module.exports = grammar(C, {
// C++ specific rules
... They then have |
I’d wager we could reference a git repo in the package.json but pushing this to NPM eventually makes sense. Seems the mainline tree-sitter languages all have 0.X tags versus committing to a “stable” 1.X release. |
Added a repo to catch this work eventually, https://github.com/stadelmanma/tree-sitter-fixed-form-fortran. |
No description provided.
The text was updated successfully, but these errors were encountered: