Tree-sitter grammar for comment tags like
FIXME(user):, etc. Useful to be embedded inside comments.
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.
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 `_`.
- Detect links?
- Detect tags that start with
#(like when linking to a PR)?
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.
- tree-sitter-rst: reStructuredText grammar.