aboutsummaryrefslogtreecommitdiffstats
path: root/queries/linkerscript/highlights.scm
diff options
context:
space:
mode:
authorPham Huy Hoang <hoangtun0810@gmail.com>2024-01-06 15:05:50 +0900
committerChristian Clason <c.clason@uni-graz.at>2024-01-19 16:58:37 +0100
commit57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch)
tree70bf645539882b88e6fa129cefd30986b89bbac3 /queries/linkerscript/highlights.scm
parentci: add query lint job (diff)
downloadnvim-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/highlights.scm')
-rw-r--r--queries/linkerscript/highlights.scm86
1 files changed, 55 insertions, 31 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