Skip to content

ember-tooling/tree-sitter-glimmer-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-sitter-glimmer-javascript

CI matrix npm

A tree-sitter grammar for Glimmer-flavored JavaScript (.gjs). Wraps tree-sitter-javascript and adds the <template>...</template> syntax used by Ember/Glimmer.

Source vs. generated files

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 definition
  • src/scanner.c — external scanner (handles <template> raw text and custom ASI behavior)
  • queries/**/*.scm — highlight, locals, and tags queries
  • test/corpus/**/*.txt — parser test fixtures
  • bindings/** — language binding code (Node, Rust, Python, Go, Swift, C)
  • binding.gyp, Cargo.toml, package.json, tree-sitter.json — build and package metadata
  • README.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 grammar
  • src/node-types.json — node type schema
  • src/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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors