SKalt / tree-sitter-tcl

draft tree-sitter grammar for TCL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tree-sitter-tcl

A tree-sitter grammar for TCL.

Status

  • lexing
    • substitutions
      • dollar substitutions: tested
      • bracket subsitutions: tested
      • escape characters: parsed, but not tested
    • array references
    • double-quote strings
  • parsing: complete. Everything's a word.
    • commands
  • highlighting: WIP
  • locals: WIP
  • tagging: WIP

Contributing

Please do! Until 2023, I'll try to review PRs with comprehensive comments and tests.

To contribute a feature or bugfix,

  • create an issue to get an idea of whether this repo's the right place for the work
  • fork &/ branch off of main
  • write conventional commits
  • make sure either the tests are passing or no new tests are failing prior to submitting a PR

I'd vaguely like to write a TCL language server, but I'm not sure I'll get to it in 2022. I ironically don't use tcl myself.

Design notes

This grammar speculatively parses all words rather than hardcoding the core language constructs and deriving which words should be recursively parsed. This trades off faster parsing for more difficult semantic analysis and a cruder grammar API for queries and syntax highlighting.

About

draft tree-sitter grammar for TCL

License:MIT License


Languages

Language:C 89.6%Language:Scheme 6.1%Language:TypeScript 1.8%Language:Rust 1.4%Language:C++ 0.4%Language:Makefile 0.3%Language:JavaScript 0.2%Language:Python 0.2%