Skip to content

Commit 7f5024f

Browse files
committed
Enhance Cab queries and update grammar
1 parent e5d7e5c commit 7f5024f

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

languages.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ indent = { tab-width = 2, unit = " " }
564564

565565
[[grammar]]
566566
name = "cab"
567-
source = { git = "https://github.com/cull-os/tree-sitter-cab", rev = "da2650f1761789e70c716d7c8c7fd6a494facdd6" }
567+
source = { git = "https://github.com/cull-os/tree-sitter-cab", rev = "3215931f6b2ee7ef91b303b2021d5bf9727f7ece" }
568568

569569
[[language]]
570570
name = "cpp"

runtime/queries/cab/highlights.scm

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,23 @@
4040

4141
(infix_operation
4242
operator: "|>"
43-
right: _ @function)
43+
right: (identifier) @function)
44+
(pattern_infix_operation
45+
operator: "|>"
46+
right: (identifier) @function)
4447

4548
(infix_operation
46-
left: _ @function
49+
left: (identifier) @function
50+
!operator)
51+
(pattern_infix_operation
52+
left: (identifier) @function
4753
!operator)
4854

4955
(infix_operation
50-
left: _ @function
56+
left: (identifier) @function
57+
operator: "<|")
58+
(pattern_infix_operation
59+
left: (identifier) @function
5160
operator: "<|")
5261

5362
(infix_operation
@@ -66,9 +75,8 @@
6675
(island)
6776
] @string.special.path
6877

69-
(pattern_identifier) @variable.parameter
70-
7178
(identifier) @variable
79+
(pattern_identifier) @variable.parameter
7280

7381
(string) @string
7482

runtime/queries/cab/textobjects.scm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(comment) @comment.inside
2+
(comment)+ @comment.around
3+
4+
(infix_operation
5+
operator: "=>") @function.around
6+
7+
(infix_operation
8+
operator: ":=") @entry.around

0 commit comments

Comments
 (0)