Fortran grammar for tree-sitter, providing a parser and syntax tree generation for Fortran code (versions 0.6.0). Released as a Python package; also available as an npm package for language bindings. Maintained community grammar with occasional releases.
pip install tree-sitter-fortranNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parse a simple Fortran program and print the syntax tree.
Use `from tree_sitter_fortran import language` and then `lang = language()`.
Use the grammar-specific package (`tree-sitter-fortran`) and import `language` directly.
Ensure your environment uses Python 3.9+ and run `pip install 'tree-sitter>=0.20'` before or alongside the grammar.
Run `pip install tree-sitter-fortran` in the correct Python environment.
Replace `from tree_sitter_fortran import LANGUAGE` with `from tree_sitter_fortran import language` and call `language()`.
Use `parser.set_language(language())` (with parentheses).