diff options
author | omentic | 2024-05-01 23:29:52 +0000 |
---|---|---|
committer | omentic | 2024-05-01 23:29:52 +0000 |
commit | 2244a5d40c83d477839f91cb6d6a4aeb02446a97 (patch) | |
tree | 732f056b43a7efbf5b2a75fda060a4cd5b87df66 /guides/rainbow_bracket_queries.html | |
parent | 313d5f75a7406da11e5b9424857be19866022e3e (diff) |
deploy: 12eec890240a05d1e090114f7f4fdd7c1ee8ff88
Diffstat (limited to 'guides/rainbow_bracket_queries.html')
-rw-r--r-- | guides/rainbow_bracket_queries.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/rainbow_bracket_queries.html b/guides/rainbow_bracket_queries.html index 98f11d99..c64d737c 100644 --- a/guides/rainbow_bracket_queries.html +++ b/guides/rainbow_bracket_queries.html @@ -196,7 +196,7 @@ language itself. These queries will go into a <code>runtime/queries/tsq/rainbows.scm</code> file in the repository root.</p> <p>First we'll add the <code>@rainbow.bracket</code> captures. TSQ only has parentheses and square brackets:</p> -<pre><code class="language-tsq">["(" ")" "[" "]"] @rainbow.bracket +<pre><code class="language-tsq">["(" ")" "[" "]"] @rainbow.bracket </code></pre> <p>The ordering of the nodes within the alternation (square brackets) is not taken into consideration.</p> @@ -207,7 +207,7 @@ names of rules in the grammar. Brackets are usually written in tree-sitter grammars as literal strings, for example:</p> <pre><code class="language-js">{ // ... - arguments: seq("(", repeat($.argument), ")"), + arguments: seq("(", repeat($.argument), ")"), // ... } </code></pre> @@ -254,7 +254,7 @@ indirect descendants of some node captured with <code>@rainbow.scope</code>.</p> </code></pre> <p>If we want to highlight the <code><</code>, <code>></code> and <code></</code> nodes with rainbow colors, we capture them as <code>@rainbow.bracket</code>:</p> -<pre><code class="language-tsq">["<" ">" "</"] @rainbow.bracket +<pre><code class="language-tsq">["<" ">" "</"] @rainbow.bracket </code></pre> <p>And we capture <code>(element)</code> as <code>@rainbow.scope</code> because <code>(element)</code> nodes nest within each other: they increment the nesting level and switch to the next |