Skip to content

Commit 311a964

Browse files
Add setup and usage instructions
Co-authored-by: Daniel Otero <[email protected]>
1 parent 8f3d7cb commit 311a964

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
1-
tree-sitter-fortran
2-
==================
1+
# tree-sitter-fortran
32

43
![Build Status](https://github.com/stadelmanma/tree-sitter-fortran/actions/workflows/ci.yml/badge.svg?branch=master)
54

65
Fortran grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). Adapted from [this Fortran grammar](http://slebok.github.io/zoo/index.html#fortran_f90_waite-cordy).
6+
7+
## Setup and usage
8+
9+
> [!IMPORTANT]
10+
> Prefer using the `tree-sitter-cli` installed from `npm` as shown below. This
11+
> is to ensure all developers use the same version of `tree-sitter`, avoiding
12+
> compatibility problems.
13+
14+
Follow these steps to set up and run `tree-sitter-fortran`:
15+
16+
1. **Clone the repository**
17+
18+
2. **Install dependencies**
19+
20+
```sh
21+
npm install
22+
```
23+
24+
3. **Generate the parser**
25+
26+
```sh
27+
npm run generate
28+
```
29+
30+
4. **Run the tests**
31+
32+
```sh
33+
npm run test
34+
```
35+
36+
5. **Update the tests (if needed)**
37+
38+
If you have modified the grammar and need to update test expectations:
39+
40+
```sh
41+
npm run test -- --update
42+
```
43+
44+
6. **Check `highlights.scm` (if needed)**
45+
46+
If you have changed nodes used in `highlights.scm`, review and update it
47+
accordingly. Even if tests pass, outdated highlights may need fixing!

0 commit comments

Comments
 (0)