fix(grammar): make brace and keyword separately queryable

This commit is contained in:
2026-05-17 06:00:21 +02:00
parent 218d2869a6
commit 6f4a0df871
7 changed files with 716 additions and 522 deletions
+5 -6
View File
@@ -1,16 +1,15 @@
; Punctuation
"{" @punctuation.bracket
"}" @punctuation.bracket
; Keywords that introduce a tag form. The grammar exposes the opening
; sequence as a hidden node, so capture the parent and let the editor
; colour the leading {block:, {/block:, {lang: literally via the
; tokenizer. The colon delimiter inside a variable_prefix tag is captured
; below.
":" @punctuation.delimiter
"-" @punctuation.delimiter
"/" @punctuation.delimiter
"=" @operator
; Block and lang keywords inside their tags: the literal "block" / "lang".
(block_keyword) @keyword.directive
(lang_keyword) @keyword.directive
; Block names. Known data-block names get @function.builtin; If/IfNot
; toggles get @keyword.conditional (theme authors may define arbitrary
; If* / IfNot* names via <meta name="if:..."> so we match by prefix).