2022-09-26 10:19:02 +01:00
|
|
|
(comment) @comment @spell
|
2021-12-14 10:47:47 +00:00
|
|
|
|
|
|
|
|
(conditional
|
2024-01-06 15:05:50 +09:00
|
|
|
(_
|
|
|
|
|
[
|
|
|
|
|
"ifeq"
|
|
|
|
|
"else"
|
|
|
|
|
"ifneq"
|
|
|
|
|
"ifdef"
|
|
|
|
|
"ifndef"
|
|
|
|
|
] @keyword.conditional)
|
|
|
|
|
"endif" @keyword.conditional)
|
2021-12-14 10:47:47 +00:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(rule
|
|
|
|
|
(targets
|
|
|
|
|
(word) @function))
|
|
|
|
|
|
|
|
|
|
(rule
|
|
|
|
|
(targets) @_target
|
|
|
|
|
(prerequisites
|
|
|
|
|
(word) @function
|
|
|
|
|
(#eq? @_target ".PHONY")))
|
2023-11-27 08:15:20 -08:00
|
|
|
|
2023-11-27 12:51:33 -08:00
|
|
|
(rule
|
2024-01-06 15:05:50 +09:00
|
|
|
(targets
|
|
|
|
|
(word) @function.builtin
|
2024-02-23 17:42:01 +09:00
|
|
|
(#any-of? @function.builtin
|
|
|
|
|
".DEFAULT" ".SUFFIXES" ".DELETE_ON_ERROR" ".EXPORT_ALL_VARIABLES" ".IGNORE" ".INTERMEDIATE"
|
|
|
|
|
".LOW_RESOLUTION_TIME" ".NOTPARALLEL" ".ONESHELL" ".PHONY" ".POSIX" ".PRECIOUS" ".SECONDARY"
|
|
|
|
|
".SECONDEXPANSION" ".SILENT" ".SUFFIXES")))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(rule
|
|
|
|
|
[
|
|
|
|
|
"&:"
|
|
|
|
|
":"
|
|
|
|
|
"::"
|
2024-01-26 15:27:52 -08:00
|
|
|
"|"
|
2024-01-06 15:05:50 +09:00
|
|
|
] @operator)
|
|
|
|
|
|
2024-05-12 18:00:55 -07:00
|
|
|
[
|
|
|
|
|
"export"
|
|
|
|
|
"unexport"
|
|
|
|
|
] @keyword.import
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(override_directive
|
|
|
|
|
"override" @keyword)
|
|
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(include_directive
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"include"
|
|
|
|
|
"-include"
|
|
|
|
|
] @keyword.import
|
2024-03-21 20:44:35 +09:00
|
|
|
filenames: (list
|
|
|
|
|
(word) @string.special.path))
|
2021-12-14 10:47:47 +00:00
|
|
|
|
|
|
|
|
(variable_assignment
|
2024-01-06 15:05:50 +09:00
|
|
|
name: (word) @string.special.symbol
|
|
|
|
|
[
|
|
|
|
|
"?="
|
|
|
|
|
":="
|
|
|
|
|
"::="
|
|
|
|
|
; ":::="
|
|
|
|
|
"+="
|
|
|
|
|
"="
|
|
|
|
|
] @operator)
|
2021-12-14 10:47:47 +00:00
|
|
|
|
2023-06-01 02:38:29 -07:00
|
|
|
(shell_assignment
|
2024-01-06 15:05:50 +09:00
|
|
|
name: (word) @string.special.symbol
|
|
|
|
|
"!=" @operator)
|
2023-06-01 02:38:29 -07:00
|
|
|
|
|
|
|
|
(define_directive
|
2024-01-06 15:05:50 +09:00
|
|
|
"define" @keyword
|
|
|
|
|
name: (word) @string.special.symbol
|
|
|
|
|
[
|
|
|
|
|
"="
|
|
|
|
|
":="
|
|
|
|
|
"::="
|
|
|
|
|
; ":::="
|
|
|
|
|
"?="
|
|
|
|
|
"!="
|
2024-01-30 22:19:54 +07:00
|
|
|
]? @operator
|
2024-01-06 15:05:50 +09:00
|
|
|
"endef" @keyword)
|
2021-12-14 10:47:47 +00:00
|
|
|
|
|
|
|
|
(variable_assignment
|
2024-01-06 15:05:50 +09:00
|
|
|
(word) @variable.builtin
|
2024-02-23 17:42:01 +09:00
|
|
|
(#any-of? @variable.builtin
|
|
|
|
|
".DEFAULT_GOAL" ".EXTRA_PREREQS" ".FEATURES" ".INCLUDE_DIRS" ".RECIPEPREFIX" ".SHELLFLAGS"
|
|
|
|
|
".VARIABLES" "MAKEARGS" "MAKEFILE_LIST" "MAKEFLAGS" "MAKE_RESTARTS" "MAKE_TERMERR"
|
|
|
|
|
"MAKE_TERMOUT" "SHELL"))
|
2021-12-14 10:47:47 +00:00
|
|
|
|
|
|
|
|
; Use string to match bash
|
2024-01-06 15:05:50 +09:00
|
|
|
(variable_reference
|
|
|
|
|
(word) @string) @operator
|
2021-12-14 10:47:47 +00:00
|
|
|
|
|
|
|
|
(shell_function
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"$"
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
] @operator
|
|
|
|
|
"shell" @function.builtin)
|
|
|
|
|
|
|
|
|
|
(function_call
|
|
|
|
|
[
|
|
|
|
|
"$"
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
] @operator)
|
|
|
|
|
|
|
|
|
|
(substitution_reference
|
|
|
|
|
[
|
|
|
|
|
"$"
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
] @operator)
|
|
|
|
|
|
2024-08-25 15:55:38 -07:00
|
|
|
(automatic_variable
|
|
|
|
|
"$"
|
|
|
|
|
_ @character.special
|
|
|
|
|
(#set! priority 105))
|
|
|
|
|
|
|
|
|
|
(automatic_variable
|
|
|
|
|
[
|
|
|
|
|
"$"
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
] @operator
|
|
|
|
|
(#set! priority 105))
|
|
|
|
|
|
|
|
|
|
(recipe_line
|
|
|
|
|
"@" @character.special)
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(function_call
|
|
|
|
|
[
|
|
|
|
|
"subst"
|
|
|
|
|
"patsubst"
|
|
|
|
|
"strip"
|
|
|
|
|
"findstring"
|
|
|
|
|
"filter"
|
|
|
|
|
"filter-out"
|
|
|
|
|
"sort"
|
|
|
|
|
"word"
|
|
|
|
|
"words"
|
|
|
|
|
"wordlist"
|
|
|
|
|
"firstword"
|
|
|
|
|
"lastword"
|
|
|
|
|
"dir"
|
|
|
|
|
"notdir"
|
|
|
|
|
"suffix"
|
|
|
|
|
"basename"
|
|
|
|
|
"addsuffix"
|
|
|
|
|
"addprefix"
|
|
|
|
|
"join"
|
|
|
|
|
"wildcard"
|
|
|
|
|
"realpath"
|
|
|
|
|
"abspath"
|
|
|
|
|
"error"
|
|
|
|
|
"warning"
|
|
|
|
|
"info"
|
|
|
|
|
"origin"
|
|
|
|
|
"flavor"
|
|
|
|
|
"foreach"
|
|
|
|
|
"if"
|
|
|
|
|
"or"
|
|
|
|
|
"and"
|
|
|
|
|
"call"
|
|
|
|
|
"eval"
|
|
|
|
|
"file"
|
|
|
|
|
"value"
|
|
|
|
|
] @function.builtin)
|
2025-09-21 16:59:47 -07:00
|
|
|
|
|
|
|
|
"\\" @punctuation.special
|