diff options
| author | r001 <rob@nyar.eu> | 2023-10-23 12:15:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-23 19:15:49 +0900 |
| commit | 0b50cf159283855b72f4c6b22f5ba3c9cf813b37 (patch) | |
| tree | 72bc3d4bddcfa5e6386bc90c1d78980c24fdcdc8 /queries | |
| parent | Update parsers: leo, liquidsoap, perl, wing (diff) | |
| download | nvim-treesitter-0b50cf159283855b72f4c6b22f5ba3c9cf813b37.tar nvim-treesitter-0b50cf159283855b72f4c6b22f5ba3c9cf813b37.tar.gz nvim-treesitter-0b50cf159283855b72f4c6b22f5ba3c9cf813b37.tar.bz2 nvim-treesitter-0b50cf159283855b72f4c6b22f5ba3c9cf813b37.tar.lz nvim-treesitter-0b50cf159283855b72f4c6b22f5ba3c9cf813b37.tar.xz nvim-treesitter-0b50cf159283855b72f4c6b22f5ba3c9cf813b37.tar.zst nvim-treesitter-0b50cf159283855b72f4c6b22f5ba3c9cf813b37.zip | |
fix(leo): highlights fixes (#5563)
* make sure affine_group has priority, so parens and comma will not be miscolored; added `annotation` as @attribute
* `then` is not used as conditional, so moved to keywords
* finalize function highlight added
* differentiate between constant and variable variable identifiers
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/leo/highlights.scm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/queries/leo/highlights.scm b/queries/leo/highlights.scm index 4114f41f9..86939e168 100644 --- a/queries/leo/highlights.scm +++ b/queries/leo/highlights.scm @@ -1,4 +1,5 @@ -(variable) @variable +(variable_identifier) @variable +(constant_identifier) @constant [ "assert" @@ -13,6 +14,7 @@ "record" "self" "struct" + "then" ] @keyword "in" @keyword.operator @@ -43,7 +45,6 @@ [ "else" "if" - "then" ] @conditional [ @@ -143,6 +144,9 @@ (transition_declaration name: (identifier) @function.builtin) +(finalizer + name: (identifier) @function.builtin) + (free_function_call (identifier) @function.call) @@ -168,10 +172,12 @@ [ (address_literal) - (affine_group_literal) + ((affine_group_literal) (#set! "priority" 101)) (field_literal) (product_group_literal) (scalar_literal) (signed_literal) (unsigned_literal) ] @number + +(annotation) @attribute |
