A tree-sitter grammar for Glimmer-flavored JavaScript (.gjs). Wraps
tree-sitter-javascript and adds the <template>...</template>
syntax used by Ember/Glimmer.
The single source of truth for the grammar is grammar.js. Most of the
files under src/ are produced by tree-sitter generate and must not
be edited by hand — any change there will be overwritten on the next
generation, and CI verifies that committed artifacts match what
generation produces.
Hand-written (edit these):
grammar.js— grammar definitionsrc/scanner.c— external scanner (handles<template>raw text and custom ASI behavior)queries/**/*.scm— highlight, locals, and tags queriestest/corpus/**/*.txt— parser test fixturesbindings/**— language binding code (Node, Rust, Python, Go, Swift, C)binding.gyp,Cargo.toml,package.json,tree-sitter.json— build and package metadataREADME.md
Auto-generated by tree-sitter generate (do not edit):
src/parser.c— the parse table (the/* Automatically @generated by tree-sitter */header is the canonical marker)src/grammar.json— JSON form of the evaluated grammarsrc/node-types.json— node type schemasrc/tree_sitter/parser.h,array.h,alloc.h— vendored tree-sitter runtime headers
If you change grammar.js or bump the tree-sitter CLI, run
npm run build (or tree-sitter generate) and commit the regenerated
files alongside your source change.