Skip to content

Commit d738334

Browse files
authored
Merge pull request stadelmanma#133 from codee-com/feature/EnsureConsistentTreeSitterVersion
Ensure consistent `tree-sitter` version and miscellanea
2 parents 64e1100 + db31218 commit d738334

File tree

4 files changed

+606
-112
lines changed

4 files changed

+606
-112
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ concurrency:
1010

1111
jobs:
1212
# npm:
13+
# if: github.repository_owner == 'stadelmanma'
1314
# uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
1415
# secrets:
1516
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1617
crates:
18+
if: github.repository_owner == 'stadelmanma'
1719
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
1820
secrets:
1921
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
2022
pypi:
23+
if: github.repository_owner == 'stadelmanma'
2124
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
2225
secrets:
2326
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}

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)