Skip to content

Commit 5508b15

Browse files
authored
Merge pull request #21821 from github/tausbn/unified-swift-grammar-cleanup-phase-1
unified: Swift grammar cleanup part 1
2 parents 9c958a4 + 911e59c commit 5508b15

6 files changed

Lines changed: 1513 additions & 1361 deletions

File tree

unified/AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ This is a CodeQL extractor based on tree-sitter.
55
## Building
66
To build the extractor, run `scripts/create-extractor-pack.sh`
77

8+
## Editing the Swift grammar
9+
The vendored tree-sitter-swift grammar lives at
10+
`extractor/tree-sitter-swift/`. After editing `grammar.js` (or any other
11+
grammar source), run `scripts/regenerate-grammar.sh` to:
12+
- regenerate `extractor/tree-sitter-swift/src/{parser.c, grammar.json,
13+
node-types.json}` (and the `src/tree_sitter/*.h` headers) via
14+
`tree-sitter generate`; and
15+
- refresh `extractor/tree-sitter-swift/node-types.yml`, the
16+
human-readable companion to `src/node-types.json` produced by yeast's
17+
`node_types_yaml` binary.
18+
19+
`node-types.yml` is the recommended review surface for grammar changes —
20+
it shows the impact of a grammar tweak on the named node kinds, fields,
21+
and child types in a form much easier to read than the raw JSON.
22+
823
## Testing
924
- If you changed the extractor code, always rebuild it before running tests.
1025

0 commit comments

Comments
 (0)