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/linkerscript | |
| 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/linkerscript')
| -rw-r--r-- | queries/linkerscript/highlights.scm | 86 | ||||
| -rw-r--r-- | queries/linkerscript/locals.scm | 17 |
2 files changed, 64 insertions, 39 deletions
diff --git a/queries/linkerscript/highlights.scm b/queries/linkerscript/highlights.scm index 0453ded85..accaad5ca 100644 --- a/queries/linkerscript/highlights.scm +++ b/queries/linkerscript/highlights.scm @@ -1,5 +1,4 @@ ; Keywords - [ "ENTRY" "SECTIONS" @@ -12,17 +11,18 @@ ] @keyword ; Conditionals - -(conditional_expression [ "?" ":" ] @keyword.conditional.ternary) +(conditional_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) ; Variables - (symbol) @variable (filename) @string.special.path ; Functions - (call_expression function: (symbol) @function.call) @@ -32,10 +32,7 @@ ((call_expression function: (symbol) @function.builtin) - (#any-of? @function.builtin - "ABSOLUTE" "ALIAS" "ADDR" "ALIGN" "ALIGNOF" "BASE" "BLOCK" "CHIP" "DATA_SEGMENT_ALIGN" - "DATA_SEGMENT_END" "DATA_SEGMENT_RELRO_END" "END" "LENGTH" "LOADADDR" "LOG2CEIL" "MAX" "MIN" - "NEXT" "ORIGIN" "SEGMENT_START" "SIZEOF" "BYTE" "FILL" "LONG" "SHORT" "QUAD" "SQUAD" "WORD")) + (#any-of? @function.builtin "ABSOLUTE" "ALIAS" "ADDR" "ALIGN" "ALIGNOF" "BASE" "BLOCK" "CHIP" "DATA_SEGMENT_ALIGN" "DATA_SEGMENT_END" "DATA_SEGMENT_RELRO_END" "END" "LENGTH" "LOADADDR" "LOG2CEIL" "MAX" "MIN" "NEXT" "ORIGIN" "SEGMENT_START" "SIZEOF" "BYTE" "FILL" "LONG" "SHORT" "QUAD" "SQUAD" "WORD")) [ "KEEP" @@ -44,42 +41,63 @@ ] @function.builtin ; Types - -(section_type "(" [ "NOLOAD" "DSECT" "COPY" "INFO" "OVERLAY" ] @type.builtin ")") +(section_type + "(" + [ + "NOLOAD" + "DSECT" + "COPY" + "INFO" + "OVERLAY" + ] @type.builtin + ")") ; Fields - [ - "ORIGIN" "org" "o" - "LENGTH" "len" "l" + "ORIGIN" + "org" + "o" + "LENGTH" + "len" + "l" ] @variable.member.builtin ; Constants - ((symbol) @constant (#lua-match? @constant "^[%u_][%u%d_]+$")) ; Labels +(entry_command + name: (symbol) @label) -(entry_command name: (symbol) @label) +(output_section + name: (symbol) @label) -(output_section name: (symbol) @label) +(memory_command + name: (symbol) @label) -(memory_command name: (symbol) @label) +(phdrs_command + name: (symbol) @label) -(phdrs_command name: (symbol) @label) - -(region ">" (symbol) @label) +(region + ">" + (symbol) @label) -(lma_region ">" (symbol) @label) +(lma_region + ">" + (symbol) @label) -(phdr ":" (symbol) @label) +(phdr + ":" + (symbol) @label) -([(symbol) (filename)] @label +([ + (symbol) + (filename) +] @label (#lua-match? @label "^%.")) ; Exceptions - "ASSERT" @keyword.exception [ @@ -88,7 +106,6 @@ ] @variable.builtin ; Operators - [ "+" "-" @@ -121,18 +138,26 @@ ] @operator ; Literals - (number) @number (quoted_symbol) @string -(wildcard_pattern [ "*" "[" "]" ] @character.special) +(wildcard_pattern + [ + "*" + "[" + "]" + ] @character.special) (attributes) @character.special ; Punctuation - -[ "{" "}" "(" ")" ] @punctuation.bracket +[ + "{" + "}" + "(" + ")" +] @punctuation.bracket [ ":" @@ -142,5 +167,4 @@ ">" @punctuation.special ; Comments - (comment) @comment @spell diff --git a/queries/linkerscript/locals.scm b/queries/linkerscript/locals.scm index 7b45dcef2..6b7660370 100644 --- a/queries/linkerscript/locals.scm +++ b/queries/linkerscript/locals.scm @@ -1,15 +1,16 @@ ; References - [ - (symbol) - (filename) - (quoted_symbol) + (symbol) + (filename) + (quoted_symbol) ] @local.reference ; Definitions +(output_section + name: (symbol) @local.definition.var) -(output_section name: (symbol) @local.definition.var) - -(memory_command name: (symbol) @local.definition.var) +(memory_command + name: (symbol) @local.definition.var) -(phdrs_command name: (symbol) @local.definition.var) +(phdrs_command + name: (symbol) @local.definition.var) |
