https://github.com/loicreynier/tree-sitter-openacc
OpenACC grammar for tree-sitter
https://github.com/loicreynier/tree-sitter-openacc
fortran openacc tree-sitter
Last synced: 3 days ago
JSON representation
OpenACC grammar for tree-sitter
- Host: GitHub
- URL: https://github.com/loicreynier/tree-sitter-openacc
- Owner: loicreynier
- License: unlicense
- Created: 2026-07-10T08:41:16.000Z (15 days ago)
- Default Branch: main
- Last Pushed: 2026-07-15T09:48:02.000Z (10 days ago)
- Last Synced: 2026-07-15T11:21:51.343Z (10 days ago)
- Topics: fortran, openacc, tree-sitter
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `tree-sitter-openacc`
OpenACC grammar for tree-sitter.
Experimental and written by someone who doesn't know a lot about tree-sitter, yet.
Written for providing syntax highlighting in OpenACC directives.
Currently only support for Fortran is provided.
## Installation (Neovim)
Installation requires building the parser, installing the parser and the highlighting,
and installing the Fortran injection.
The later extends global injections such as the one from [`nvim-treesitter`][nvim-treesitter].
### Manual
```bash
tree-sitter build
mkdir -p ~/.config/nvim/parser ~/.config/nvim/queries/after/{openacc,fortran}
cp ./openacc.so ~/.config/nvim/parser
cp ./queries/highlights.scm ~/.config/nvim/queries/after/openacc
cp ./fortran-injections.scm ~/.config/nvim/queries/after/fortran
```
### [`nvim-treesitter`][nvim-treesitter]
```lua
vim.api.nvim_create_autocmd("User", {
pattern = "TSUpdate",
callback = function()
---@diagnostic disable-next-line: missing-fields
require("nvim-treesitter.parsers").openacc = {
install_info = {
url = "https://github.com/loicreynier/tree-sitter-openacc",
revision = "b17931de5e809e7b1fd094876fd96a73d0d045b6",
queries = "queries",
},
}
end,
})
```
```bash
curl -L -o ~/.config/nvim/after/queries/fortran/injections.scm https://raw.githubusercontent.com/loicreynier/tree-sitter-openacc/refs/heads/main/fortran-injections.scm
```
[nvim-treesitter]: https://github.com/nvim-treesitter/nvim-treesitter