A tree-sitter parser for GritQL files.
GritQl is an AST-aware query language for searching and transforming source code.
language js
`console.log($my_message)` => `winston.info($my_message)` where {
$my_message <: string()
}
Explore the interactive tutorial to learn more about GritQL.
A TextMate grammar for GritQL lives in syntaxes/gritql.tmLanguage.json and ships with the npm package. Its scope name is source.gritql, and it covers both the Grit (Marzano) syntax in this repo and the GritQL dialect used by Biome plugins. It can be used by VS Code, Shiki, and GitHub Linguist.
The grammar has snapshot tests that run vscode-tmgrammar-test against the fixtures in test/grammar/. The fixtures are copied unchanged from real GritQL sources (Biome's and Marzano's test suites, and this repo's corpus); test/grammar/SOURCES.md lists where each one came from. Files in test/grammar/biome/ are valid Biome plugins, and files in test/grammar/marzano/ are valid for Grit's Marzano engine.
npm run test:grammarAfter changing the grammar, regenerate the snapshots with npx vscode-tmgrammar-snap -s source.gritql -g syntaxes/gritql.tmLanguage.json --updateSnapshot "test/grammar/**/*.grit", then review the .snap diffs.