Skip to content

Repository files navigation

tree-sitter-gray

Tree-sitter grammar for the Grayscale programming language.

Usage

This grammar is used by GrayLS for syntax highlighting in Zed.

Updating the Grammar

Prerequisites

npm install -g tree-sitter-cli

Making Changes

  1. Edit grammar.js to add/modify syntax rules

  2. Regenerate the parser:

    tree-sitter generate
  3. Test parsing (optional):

    tree-sitter parse path/to/file.gray
  4. Commit and push:

    git add -A
    git commit -m "feat: description of change"
    git push
  5. Update GrayLS with the new commit SHA

Structure

File Purpose
grammar.js Grammar definition (edit this)
src/parser.c Generated parser (don't edit)
src/node-types.json Generated node types (don't edit)

Related

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages