Skip to content

technique-lang/tree-sitter-technique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tree Sitter grammar for the Technique procedures language

The Tree Sitter grammar here is ONLY to produce tokens for the purpose of syntax highlighting a Technique file in the the Zed Editor. It is not a complete parser to a full abstract syntax tree.

The Technique compiler's command-line program has been taught to code format input source files with the format subcommand:

technique format -R Example.tq

(where -R is to ensure raw ANSI escape code are generated even if output is redirected). The requirement is that other editors' syntax highlighting matches the output of the format subcommand, which is authoritative for colouring.

Development and Testing

The sequence of commands to iterate on this grammar is:

$ tree-sitter generate
$ tree-sitter parse Example.tq
$ tree-sitter highlight Example.tq

You will also need a ~/.config/tree-sitter/config.json file with content along the lines of:

{
  "parser-directories": [
    "/home/andrew/src/technique-lang",
  ],
}

where ~/src/technique-lang/ contains the checkout of this repository. A sample config file is in the config/ directory here, which also includes the default colour palette used for rendering Technique files correctly.

About

Technique grammar for Tree Sitter.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published