All Projects → stsewd → tree-sitter-comment

stsewd / tree-sitter-comment

Licence: MIT license
Tree-sitter grammar for comment tags like TODO, FIXME(user).

Programming Languages

c
50402 projects - #5 most used programming language
rust
11053 projects
javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tree-sitter-comment

tree-sitter-rescript
ReScript parser for Tree-Sitter
Stars: ✭ 20 (-76.74%)
Mutual labels:  tree-sitter, tree-sitter-parser
recursive-comments
Build recursive, nested or threaded commenting system using laravel and vuejs
Stars: ✭ 13 (-84.88%)
Mutual labels:  comments
tree-sitter-rust
Rust grammar for tree-sitter
Stars: ✭ 199 (+131.4%)
Mutual labels:  tree-sitter
tree-sitter-lua
Lua grammar for tree-sitter.
Stars: ✭ 40 (-53.49%)
Mutual labels:  tree-sitter
tree-sitter-cli
CLI tool for creating and testing tree-sitter parsers
Stars: ✭ 43 (-50%)
Mutual labels:  tree-sitter
tree-sitter-hcl
A tree-sitter grammar for HCL (HashiCorp Configuration Language), used by projects such as Terraform.
Stars: ✭ 65 (-24.42%)
Mutual labels:  tree-sitter
tree-sitter-php
PHP grammar for tree-sitter
Stars: ✭ 83 (-3.49%)
Mutual labels:  tree-sitter
Youtube-Comment-Bot
A YouTube API Comment bot, better faster and free!
Stars: ✭ 58 (-32.56%)
Mutual labels:  comments
KirbyComments
[Kirby 2] File-based comments stored as subpages for the Kirby CMS.
Stars: ✭ 68 (-20.93%)
Mutual labels:  comments
reason-tree-sitter
ReasonML bindings for tree-sitter
Stars: ✭ 22 (-74.42%)
Mutual labels:  tree-sitter
BugKotlinDocument
Plugin for IntelliJ IDEA ┗😃┛ Android Studio ┗😃┛ CLion ┗😃┛ AppCode.
Stars: ✭ 29 (-66.28%)
Mutual labels:  comments
swift-tree-sitter
Swift bindings for the tree-sitter parsing library
Stars: ✭ 29 (-66.28%)
Mutual labels:  tree-sitter
VsTeXCommentsExtension
TeX comments rendering inside Visual Studio.
Stars: ✭ 48 (-44.19%)
Mutual labels:  comments
haskell-tree-sitter
Haskell bindings for tree-sitter
Stars: ✭ 123 (+43.02%)
Mutual labels:  tree-sitter
tree-sitter-css
CSS grammar for Tree-sitter
Stars: ✭ 57 (-33.72%)
Mutual labels:  tree-sitter
tree-sitter.el
An Emacs dynamic module exposing tree-sitter.
Stars: ✭ 59 (-31.4%)
Mutual labels:  tree-sitter
jekyll-aws-comments
Static comments for Jekyll with AWS Lambda and GitHub.
Stars: ✭ 17 (-80.23%)
Mutual labels:  comments
ltreesitter
Standalone tree sitter bindings for the Lua language
Stars: ✭ 62 (-27.91%)
Mutual labels:  tree-sitter
tree-sitter-regex
Tree-sitter parser for regular expressions
Stars: ✭ 42 (-51.16%)
Mutual labels:  tree-sitter
kosmikoa.nvim
A dark color scheme for Neovim with support for LSP, Treesitter. This mirror is deprecated. Use the repo at https://sr.ht/~novakane/kosmikoa.nvim/
Stars: ✭ 23 (-73.26%)
Mutual labels:  tree-sitter

tree-sitter-comment

Tree-sitter grammar for comment tags like TODO:, FIXME(user):, etc. Useful to be embedded inside comments.

Check the playground at https://stsewd.dev/tree-sitter-comment/.

Syntax

Since comment tags aren't a programming language or have a standard, I have chosen to follow popular conventions for the syntax.

  • Comment tags can contain:
    • Upper case ascii letters
    • Numbers (can't start with one)
    • -, _ (they can't start or end whit these characters)
  • Optionally can have an user linked to the tag inside parentheses ()
  • The name must be followed by : and a whitespace

If you think there are other popular conventions this syntax doesn't cover, feel free to open a issue.

Examples

TODO: something needs to be done
TODO(stsewd): something needs to be done by @stsewd

XXX: fix something else.
XXX:    extra white spaces.

(NOTE: this works too).

NOTE-BUG (stsewd): tags can be separated by `-`
NOTE_BUG: or by `_`.

TODO

  • Detect links?
  • Detect tags that start with # (like when linking to a PR)?

Why C?

Tree-sitter is a LR parser for context-free grammars, that means it works great for grammars that don't require backtracking, or to keep a state for whitespaces (like indentation). For these reasons, parsing languages that need to keep a state or falling back to a general token, it requires some manual parsing in C.

Other grammars

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].