diff options
| author | Pham Huy Hoang <hoangtun0810@gmail.com> | 2024-01-06 15:05:50 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-01-19 16:58:37 +0100 |
| commit | 57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch) | |
| tree | 70bf645539882b88e6fa129cefd30986b89bbac3 /queries/tablegen | |
| parent | ci: add query lint job (diff) | |
| download | nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.gz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.bz2 nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.lz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.xz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.zst nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.zip | |
chore: query formatting
Diffstat (limited to 'queries/tablegen')
| -rw-r--r-- | queries/tablegen/folds.scm | 2 | ||||
| -rw-r--r-- | queries/tablegen/highlights.scm | 84 | ||||
| -rw-r--r-- | queries/tablegen/indents.scm | 22 | ||||
| -rw-r--r-- | queries/tablegen/locals.scm | 14 |
4 files changed, 71 insertions, 51 deletions
diff --git a/queries/tablegen/folds.scm b/queries/tablegen/folds.scm index a1727b151..0e95ca527 100644 --- a/queries/tablegen/folds.scm +++ b/queries/tablegen/folds.scm @@ -8,6 +8,6 @@ (defvar) (foreach) (if) - (let) + (let) (value_suffix) ] @fold diff --git a/queries/tablegen/highlights.scm b/queries/tablegen/highlights.scm index aea94b4eb..7c6d71753 100644 --- a/queries/tablegen/highlights.scm +++ b/queries/tablegen/highlights.scm @@ -1,13 +1,10 @@ ; Preprocs - (preprocessor_directive) @keyword.directive ; Includes - "include" @keyword.import ; Keywords - [ "assert" "class" @@ -20,12 +17,9 @@ "defvar" ] @keyword -[ - "in" -] @keyword.operator +"in" @keyword.operator ; Conditionals - [ "if" "else" @@ -33,24 +27,18 @@ ] @keyword.conditional ; Repeats - -[ - "foreach" -] @keyword.repeat +"foreach" @keyword.repeat ; Variables - (identifier) @variable -(var) @variable.builtin +(var) @variable.builtin ; Parameters - -(template_arg (identifier) @variable.parameter) - +(template_arg + (identifier) @variable.parameter) ; Types - (type) @type [ @@ -63,27 +51,41 @@ "code" ] @type.builtin -(class name: (identifier) @type) +(class + name: (identifier) @type) -(multiclass name: (identifier) @type) +(multiclass + name: (identifier) @type) -(def name: (value (_) @type)) +(def + name: + (value + (_) @type)) -(defm name: (value (_) @type)) +(defm + name: + (value + (_) @type)) -(defset name: (identifier) @type) +(defset + name: (identifier) @type) -(parent_class_list (identifier) @type (value (_) @type)?) +(parent_class_list + (identifier) @type + (value + (_) @type)?) -(anonymous_record (identifier) @type) +(anonymous_record + (identifier) @type) -(anonymous_record (value (_) @type)) +(anonymous_record + (value + (_) @type)) ((identifier) @type (#lua-match? @type "^_*[A-Z][A-Z0-9_]+$")) ; Fields - (instruction (identifier) @variable.member) @@ -91,7 +93,6 @@ (identifier) @variable.member) ; Functions - ([ (bang_operator) (cond_operator) @@ -99,7 +100,6 @@ (#set! "priority" 105)) ; Operators - [ "=" "#" @@ -109,7 +109,6 @@ ] @operator ; Literals - (string) @string (code) @string.special @@ -121,14 +120,25 @@ (uninitialized_value) @constant.builtin ; Punctuation +[ + "{" + "}" +] @punctuation.bracket -[ "{" "}" ] @punctuation.bracket - -[ "[" "]" ] @punctuation.bracket +[ + "[" + "]" +] @punctuation.bracket -[ "(" ")" ] @punctuation.bracket +[ + "(" + ")" +] @punctuation.bracket -[ "<" ">" ] @punctuation.bracket +[ + "<" + ">" +] @punctuation.bracket [ "." @@ -136,17 +146,13 @@ ";" ] @punctuation.delimiter -[ - "!" -] @punctuation.special +"!" @punctuation.special ; Comments - [ (comment) (multiline_comment) ] @comment @spell - ((comment) @keyword.directive (#lua-match? @keyword.directive "^.*RUN")) diff --git a/queries/tablegen/indents.scm b/queries/tablegen/indents.scm index 5d73f8848..16748edf1 100644 --- a/queries/tablegen/indents.scm +++ b/queries/tablegen/indents.scm @@ -7,7 +7,7 @@ (defvar) (foreach) (if) - (let) + (let) (value_suffix) ] @indent.begin @@ -18,10 +18,22 @@ ">" ] @indent.end -[ "{" "}" ] @indent.branch +[ + "{" + "}" +] @indent.branch -[ "[" "]" ] @indent.branch +[ + "[" + "]" +] @indent.branch -[ "(" ")" ] @indent.branch +[ + "(" + ")" +] @indent.branch -[ "<" ">" ] @indent.branch +[ + "<" + ">" +] @indent.branch diff --git a/queries/tablegen/locals.scm b/queries/tablegen/locals.scm index f1404adb6..98c52ceac 100644 --- a/queries/tablegen/locals.scm +++ b/queries/tablegen/locals.scm @@ -1,5 +1,4 @@ ; Scopes - [ (class) (multiclass) @@ -13,14 +12,12 @@ ] @local.scope ; References - [ (var) (identifier) ] @local.reference ; Definitions - (instruction (identifier) @local.definition.field) @@ -30,7 +27,8 @@ (include_directive (string) @local.definition.import) -(template_arg (identifier) @local.definition.parameter) +(template_arg + (identifier) @local.definition.parameter) (class name: (identifier) @local.definition.type) @@ -39,10 +37,14 @@ name: (identifier) @local.definition.type) (def - name: (value (_) @local.definition.type)) + name: + (value + (_) @local.definition.type)) (defm - name: (value (_) @local.definition.type)) + name: + (value + (_) @local.definition.type)) (defset name: (identifier) @local.definition.type) |
