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"
  (3f44b89685/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`
This commit is contained in:
Christian Clason 2023-12-24 10:00:20 +01:00
parent 10dd49958c
commit 1ae9b0e455
263 changed files with 2356 additions and 2337 deletions

View file

@ -84,16 +84,88 @@ you can mark the language as optional (by putting it between parenthesis).
As languages differ quite a lot, here is a set of captures available to you when building a `highlights.scm` query. Note that your colorscheme needs to define (or link) these captures as highlight groups. As languages differ quite a lot, here is a set of captures available to you when building a `highlights.scm` query. Note that your colorscheme needs to define (or link) these captures as highlight groups.
#### Misc #### Identifiers
```scheme ```query
@comment ; line and block comments @variable ; various variable names
@comment.documentation ; comments documenting code @variable.builtin ; built-in variable names (e.g. `this`)
@error ; syntax/parser errors @variable.parameter ; parameters of a function
@none ; completely disable the highlight @variable.member ; object and struct fields
@preproc ; various preprocessor directives & shebangs
@define ; preprocessor definition directives @constant ; constant identifiers
@operator ; symbolic operators (e.g. `+` / `*`) @constant.builtin ; built-in constant values
@constant.macro ; constants defined by the preprocessor
@module ; modules or namespaces
@module.builtin ; built-in modules or namespaces
@label ; GOTO and other labels (e.g. `label:` in C), including heredoc labels
```
#### Literals
```query
@string ; string literals
@string.documentation ; string documenting code (e.g. Python docstrings)
@string.regexp ; regular expressions
@string.escape ; escape sequences
@string.special ; other special strings (e.g. dates)
@string.special.symbol ; symbols or atoms
@string.special.url ; URIs (e.g. hyperlinks)
@string.special.path ; filenames
@character ; character literals
@character.special ; special characters (e.g. wildcards)
@boolean ; boolean literals
@number ; numeric literals
@number.float ; floating-point number literals
```
#### Types
```query
@type ; type or class definitions and annotations
@type.builtin ; built-in types
@type.definition ; identifiers in type definitions (e.g. `typedef <type> <identifier>` in C)
@type.qualifier ; type qualifiers (e.g. `const`)
@attribute ; attribute annotations (e.g. Python decorators)
@property ; the key in key/value pairs
```
#### Functions
```query
@function ; function definitions
@function.builtin ; built-in functions
@function.call ; function calls
@function.macro ; preprocessor macros
@function.method ; method definitions
@function.method.call ; method calls
@constructor ; constructor calls and definitions
@operator ; symbolic operators (e.g. `+` / `*`)
```
#### Keywords
```query
@keyword ; keywords not fitting into specific categories
@keyword.coroutine ; keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)
@keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python)
@keyword.operator ; operators that are English words (e.g. `and` / `or`)
@keyword.import ; keywords for including modules (e.g. `import` / `from` in Python)
@keyword.storage ; modifiers that affect storage in memory or life-time
@keyword.repeat ; keywords related to loops (e.g. `for` / `while`)
@keyword.return ; keywords like `return` and `yield`
@keyword.debug ; keywords related to debugging
@keyword.exception ; keywords related to exceptions (e.g. `throw` / `catch`)
@keyword.conditional ; keywords related to conditionals (e.g. `if` / `else`)
@keyword.conditional.ternary ; ternary operator (e.g. `?` / `:`)
@keyword.directive ; various preprocessor directives & shebangs
@keyword.directive.define ; preprocessor definition directives
``` ```
#### Punctuation #### Punctuation
@ -104,119 +176,53 @@ As languages differ quite a lot, here is a set of captures available to you when
@punctuation.special ; special symbols (e.g. `{}` in string interpolation) @punctuation.special ; special symbols (e.g. `{}` in string interpolation)
``` ```
#### Literals #### Comments
```scheme ```query
@string ; string literals @comment ; line and block comments
@string.documentation ; string documenting code (e.g. Python docstrings) @comment.documentation ; comments documenting code
@string.regex ; regular expressions
@string.escape ; escape sequences
@string.special ; other special strings (e.g. dates)
@character ; character literals @comment.error ; error-type comments (e.g., `DEPRECATED:`)
@character.special ; special characters (e.g. wildcards) @comment.warning ; warning-type comments (e.g., `WARNING:`, `FIX:`)
@comment.hint ; note-type comments (e.g., `NOTE:`)
@boolean ; boolean literals @comment.info ; info-type comments
@number ; numeric literals @comment.todo ; todo-type comments (e.g-, `TODO:`, `WIP:`)
@float ; floating-point number literals
``` ```
#### Functions #### Markup
```scheme
@function ; function definitions
@function.builtin ; built-in functions
@function.call ; function calls
@function.macro ; preprocessor macros
@method ; method definitions
@method.call ; method calls
@constructor ; constructor calls and definitions
@parameter ; parameters of a function
```
#### Keywords
```scheme
@keyword ; various keywords
@keyword.coroutine ; keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)
@keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python)
@keyword.operator ; operators that are English words (e.g. `and` / `or`)
@keyword.return ; keywords like `return` and `yield`
@conditional ; keywords related to conditionals (e.g. `if` / `else`)
@conditional.ternary ; ternary operator (e.g. `?` / `:`)
@repeat ; keywords related to loops (e.g. `for` / `while`)
@debug ; keywords related to debugging
@label ; GOTO and other labels (e.g. `label:` in C)
@include ; keywords for including modules (e.g. `import` / `from` in Python)
@exception ; keywords related to exceptions (e.g. `throw` / `catch`)
```
#### Types
```scheme
@type ; type or class definitions and annotations
@type.builtin ; built-in types
@type.definition ; identifiers in type definitions (e.g. `typedef <type> <identifier>` in C)
@type.qualifier ; type qualifiers (e.g. `const`)
@storageclass ; modifiers that affect storage in memory or life-time
@attribute ; attribute annotations (e.g. Python decorators)
@field ; object and struct fields
@property ; similar to `@field`
```
#### Identifiers
```scheme
@variable ; various variable names
@variable.builtin ; built-in variable names (e.g. `this`)
@constant ; constant identifiers
@constant.builtin ; built-in constant values
@constant.macro ; constants defined by the preprocessor
@namespace ; modules or namespaces
@symbol ; symbols or atoms
```
#### Text
Mainly for markup languages. Mainly for markup languages.
```scheme ```query
@text ; non-structured text @markup.strong ; bold text
@text.strong ; bold text @markup.italic ; text with emphasis
@text.emphasis ; text with emphasis @markup.strikethrough ; strikethrough text
@text.underline ; underlined text @markup.underline ; underlined text (only for literal underline markup!)
@text.strike ; strikethrough text
@text.title ; text that is part of a title
@text.quote ; text quotations
@text.uri ; URIs (e.g. hyperlinks)
@text.math ; math environments (e.g. `$ ... $` in LaTeX)
@text.environment ; text environments of markup languages
@text.environment.name ; text indicating the type of an environment
@text.reference ; text references, footnotes, citations, etc.
@text.literal ; literal or verbatim text (e.g., inline code) @markup.heading ; headings, titles (including markers)
@text.literal.block ; literal or verbatim text as a stand-alone block
@markup.quote ; block quotes
@markup.math ; math environments (e.g. `$ ... $` in LaTeX)
@markup.environment ; environments (e.g. in LaTeX)
@markup.link ; text references, footnotes, citations, etc.
@markup.link.label ; link, reference descriptions
@markup.link.url ; URL-style links
@markup.raw ; literal or verbatim text (e.g., inline code)
@markup.raw.block ; literal or verbatim text as a stand-alone block
; (use priority 90 for blocks with injections) ; (use priority 90 for blocks with injections)
@text.todo ; todo notes @markup.list ; list markers
@text.note ; info notes @markup.list.checked ; checked todo-style list markers
@text.warning ; warning notes @markup.list.unchecked ; unchecked todo-style list markers
@text.danger ; danger/error notes
@text.diff.add ; added text (for diff files)
@text.diff.delete ; deleted text (for diff files)
``` ```
#### Tags ```query
@diff.plus ; added text (for diff files)
Used for XML-like tags. @diff.minus ; deleted text (for diff files)
@diff.delta ; changed text (for diff files)
```
```scheme ```scheme
@tag ; XML tag names @tag ; XML tag names
@ -224,17 +230,14 @@ Used for XML-like tags.
@tag.delimiter ; XML tag delimiters @tag.delimiter ; XML tag delimiters
``` ```
#### Conceal #### Non-highlighting captures
```scheme ```query
@conceal ; for captures that are only used for concealing @none ; completely disable the highlight
@conceal ; captures that are only meant to be concealed
``` ```
`@conceal` must be followed by `(#set! conceal "")`. ```query
#### Spell
```scheme
@spell ; for defining regions to be spellchecked @spell ; for defining regions to be spellchecked
@nospell ; for defining regions that should NOT be spellchecked @nospell ; for defining regions that should NOT be spellchecked
``` ```
@ -243,6 +246,25 @@ The main types of nodes which are spell checked are:
- Comments - Comments
- Strings; where it makes sense. Strings that have interpolation or are typically used for non text purposes are not spell checked (e.g. bash). - Strings; where it makes sense. Strings that have interpolation or are typically used for non text purposes are not spell checked (e.g. bash).
#### Predicates
Captures can be restricted according to node contents using [predicates](https://neovim.io/doc/user/treesitter.html#treesitter-predicates). For performance reasons, prefer earlier predicates in this list:
1. `#eq?` (literal match)
2. `#any-of?` (one of several literal matches)
3. `#lua-match?` (match against a [Lua pattern](https://neovim.io/doc/user/luaref.html#lua-pattern))
4. `#match?`/`#vim-match?` (match against a [Vim regular expression](https://neovim.io/doc/user/pattern.html#regexp)
#### Conceal
Captures can be concealed by setting the [`conceal` metadata](https://neovim.io/doc/user/treesitter.html#treesitter-highlight-conceal), e.g..,
```query
(fenced_code_block_delimiter @markup.raw.block (#set! conceal ""))
```
The capture should be meaningful to allow proper highlighting when `set conceallevel=0`. If the unconcealed capture should not be highlighted (e.g., because an earlier pattern handles this), you can use `@conceal`.
A conceal can be restricted to part of the capture via the [`#offset!` directive](https://neovim.io/doc/user/treesitter.html#treesitter-directive-offset%21).
#### Priority #### Priority
Captures can be assigned a priority to control precedence of highlights via the Captures can be assigned a priority to control precedence of highlights via the

View file

@ -44,7 +44,7 @@
"aliased" "aliased"
"constant" "constant"
"renames" "renames"
] @storageclass ] @keyword.storage
[ [
"mod" "mod"
"new" "new"
@ -56,7 +56,7 @@
[ [
"with" "with"
"use" "use"
] @include ] @keyword.import
[ [
"body" "body"
"function" "function"
@ -79,7 +79,7 @@
"parallel" "parallel"
"reverse" "reverse"
"some" "some"
] @repeat ] @keyword.repeat
[ [
"return" "return"
] @keyword.return ] @keyword.return
@ -90,11 +90,11 @@
"then" "then"
"elsif" "elsif"
"select" "select"
] @conditional ] @keyword.conditional
[ [
"exception" "exception"
"raise" "raise"
] @exception ] @keyword.exception
(comment) @comment @spell (comment) @comment @spell
(string_literal) @string (string_literal) @string
(character_literal) @string (character_literal) @string
@ -109,24 +109,24 @@
(entry_declaration . (identifier) @function) (entry_declaration . (identifier) @function)
;; Some keywords should take different categories depending on the context ;; Some keywords should take different categories depending on the context
(use_clause "use" @include "type" @include) (use_clause "use" @keyword.import "type" @keyword.import)
(with_clause "private" @include) (with_clause "private" @keyword.import)
(with_clause "limited" @include) (with_clause "limited" @keyword.import)
(use_clause (_) @namespace) (use_clause (_) @module)
(with_clause (_) @namespace) (with_clause (_) @module)
(loop_statement "end" @keyword.repeat) (loop_statement "end" @keyword.repeat)
(if_statement "end" @conditional) (if_statement "end" @keyword.conditional)
(loop_parameter_specification "in" @keyword.repeat) (loop_parameter_specification "in" @keyword.repeat)
(loop_parameter_specification "in" @keyword.repeat) (loop_parameter_specification "in" @keyword.repeat)
(iterator_specification ["in" "of"] @keyword.repeat) (iterator_specification ["in" "of"] @keyword.repeat)
(range_attribute_designator "range" @keyword.repeat) (range_attribute_designator "range" @keyword.repeat)
(raise_statement "with" @exception) (raise_statement "with" @keyword.exception)
(gnatprep_declarative_if_statement) @preproc (gnatprep_declarative_if_statement) @keyword.directive
(gnatprep_if_statement) @preproc (gnatprep_if_statement) @keyword.directive
(gnatprep_identifier) @preproc (gnatprep_identifier) @keyword.directive
(subprogram_declaration "is" @keyword.function "abstract" @keyword.function) (subprogram_declaration "is" @keyword.function "abstract" @keyword.function)
(aspect_specification "with" @keyword.function) (aspect_specification "with" @keyword.function)

View file

@ -27,13 +27,13 @@
;; Imports and Module Declarations ;; Imports and Module Declarations
"import" @include "import" @keyword.import
(module_name) @namespace (module_name) @module
;; Pragmas and comments ;; Pragmas and comments
(pragma) @preproc (pragma) @keyword.directive
(comment) @comment @spell (comment) @comment @spell

View file

@ -6,7 +6,7 @@
name: (identifier) @function) name: (identifier) @function)
(pipe_call (pipe_call
arguments: (pipe_arguments arguments: (pipe_arguments
(identifier) @parameter)) (identifier) @variable.parameter))
(structural_assignment (structural_assignment
operator: (identifier) @keyword) operator: (identifier) @keyword)

View file

@ -28,10 +28,10 @@
;; Methods ;; Methods
(method_declaration (method_declaration
name: (identifier) @method) name: (identifier) @function.method)
(method_invocation (method_invocation
name: (identifier) @method.call) name: (identifier) @function.method.call)
(super) @function.builtin (super) @function.builtin
@ -77,7 +77,7 @@
(method_declaration (method_declaration
(formal_parameters (formal_parameters
(formal_parameter (formal_parameter
name: (identifier) @parameter))) name: (identifier) @variable.parameter)))
(constructor_declaration (constructor_declaration
name: (identifier) @constructor) name: (identifier) @constructor)
@ -142,10 +142,10 @@
(field_declaration (field_declaration
declarator: (variable_declarator declarator: (variable_declarator
name: (identifier) @field)) name: (identifier) @variable.member))
(field_access (field_access
field: (identifier) @field) field: (identifier) @variable.member)
; Variables ; Variables
@ -194,14 +194,14 @@
"if" "if"
"else" "else"
"switch" "switch"
] @conditional ] @keyword.conditional
[ [
"for" "for"
"while" "while"
"do" "do"
"break" "break"
] @repeat ] @keyword.repeat
[ [
"return" "return"
@ -212,7 +212,7 @@
"finally" "finally"
"try" "try"
"catch" "catch"
] @exception ] @keyword.exception
"new" @keyword.operator "new" @keyword.operator

View file

@ -47,21 +47,21 @@
(number) @number (number) @number
(string) @string (string) @string
(regex) @string.regex (regex) @string.regexp
(escape_sequence) @string.escape (escape_sequence) @string.escape
(comment) @comment @spell (comment) @comment @spell
((program . (comment) @preproc) ((program . (comment) @keyword.directive)
(#lua-match? @preproc "^#!/")) (#lua-match? @keyword.directive "^#!/"))
(ns_qualified_name (namespace) @namespace) (ns_qualified_name (namespace) @module)
(ns_qualified_name "::" @punctuation.delimiter) (ns_qualified_name "::" @punctuation.delimiter)
(func_def name: (_ (identifier) @function) @function) (func_def name: (_ (identifier) @function) @function)
(func_call name: (_ (identifier) @function) @function) (func_call name: (_ (identifier) @function) @function)
(func_def (param_list (identifier) @parameter)) (func_def (param_list (identifier) @variable.parameter))
[ [
"print" "print"
@ -92,7 +92,7 @@
"while" "while"
"for" "for"
"in" "in"
] @repeat ] @keyword.repeat
[ [
"if" "if"
@ -100,14 +100,14 @@
"switch" "switch"
"case" "case"
"default" "default"
] @conditional ] @keyword.conditional
[ [
"@include" "@include"
"@load" "@load"
] @include ] @keyword.import
"@namespace" @preproc "@namespace" @keyword.directive
[ [
"BEGIN" "BEGIN"
@ -156,7 +156,7 @@
(ternary_exp [ (ternary_exp [
"?" "?"
":" ":"
] @conditional.ternary) ] @keyword.conditional.ternary)
(update_exp [ (update_exp [
"++" "++"

View file

@ -70,7 +70,7 @@
"case" "case"
"in" "in"
"esac" "esac"
] @conditional ] @keyword.conditional
[ [
"for" "for"
@ -79,7 +79,7 @@
"select" "select"
"until" "until"
"while" "while"
] @repeat ] @keyword.repeat
[ [
"declare" "declare"
@ -115,7 +115,7 @@
(arithmetic_expansion "," @punctuation.delimiter) (arithmetic_expansion "," @punctuation.delimiter)
(ternary_expression [ "?" ":" ] @conditional.ternary) (ternary_expression [ "?" ":" ] @keyword.conditional.ternary)
(binary_expression operator: _ @operator) (binary_expression operator: _ @operator)
(unary_expression operator: _ @operator) (unary_expression operator: _ @operator)
@ -140,8 +140,8 @@
(command (command
argument: [ argument: [
(word) @parameter (word) @variable.parameter
(concatenation (word) @parameter) (concatenation (word) @variable.parameter)
]) ])
(number) @number (number) @number
@ -149,7 +149,7 @@
(#lua-match? @number "^[0-9]+$")) (#lua-match? @number "^[0-9]+$"))
(file_redirect (file_redirect
destination: (word) @parameter) destination: (word) @variable.parameter)
(file_descriptor) @operator (file_descriptor) @operator
@ -175,12 +175,12 @@
(#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) (#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
(case_item (case_item
value: (word) @parameter) value: (word) @variable.parameter)
[ [
(regex) (regex)
(extglob_pattern) (extglob_pattern)
] @string.regex ] @string.regexp
((program . (comment) @preproc) ((program . (comment) @keyword.directive)
(#lua-match? @preproc "^#!/")) (#lua-match? @keyword.directive "^#!/"))

View file

@ -21,13 +21,13 @@
;; Namespaces ;; Namespaces
(symbind (symbind
(symbol) @namespace (symbol) @module
. (keyword)) . (keyword))
;; Includes ;; Includes
((symbol) @include ((symbol) @keyword.import
(#any-of? @include "use" "import" "load")) (#any-of? @keyword.import "use" "import" "load"))
;; Keywords ;; Keywords
@ -43,13 +43,13 @@
((list ((list
. (symbol) @keyword.function . (symbol) @keyword.function
. (symbol) @function . (symbol) @function
(symbol)? @parameter) (symbol)? @variable.parameter)
(#any-of? @keyword.function "def" "defop" "defn" "fn")) (#any-of? @keyword.function "def" "defop" "defn" "fn"))
((cons ((cons
. (symbol) @keyword.function . (symbol) @keyword.function
. (symbol) @function . (symbol) @function
(symbol)? @parameter) (symbol)? @variable.parameter)
(#any-of? @keyword.function "def" "defop" "defn" "fn")) (#any-of? @keyword.function "def" "defop" "defn" "fn"))
((symbol) @function.builtin ((symbol) @function.builtin
@ -60,13 +60,13 @@
;; Conditionals ;; Conditionals
((symbol) @conditional ((symbol) @keyword.conditional
(#any-of? @conditional "if" "case" "cond" "when")) (#any-of? @keyword.conditional "if" "case" "cond" "when"))
;; Repeats ;; Repeats
((symbol) @repeat ((symbol) @keyword.repeat
(#any-of? @repeat "each")) (#any-of? @keyword.repeat "each"))
;; Operators ;; Operators
@ -89,7 +89,7 @@
(escape_sequence) @string.escape (escape_sequence) @string.escape
(path) @text.uri @string.special (path) @string.special.url
(number) @number (number) @number

View file

@ -1,4 +1,4 @@
(date) @field (date) @variable.member
(txn) @attribute (txn) @attribute
(account) @type (account) @type
(amount) @number (amount) @number

View file

@ -23,10 +23,10 @@
(number) @number (number) @number
(field (field
name: (identifier) @field) name: (identifier) @variable.member)
(token (token
(identifier) @parameter) (identifier) @variable.parameter)
[ [
(brace_word) (brace_word)
@ -36,7 +36,7 @@
[ [
(key_brace) (key_brace)
(key_paren) (key_paren)
] @symbol ] @string.special.symbol
(string (string
name: (identifier) @constant) name: (identifier) @constant)

View file

@ -1,16 +1,16 @@
; Includes ; Includes
(import_statement (import_statement
"import" @include) "import" @keyword.import)
(import_with_statement (import_with_statement
"import" @include "import" @keyword.import
"with" @include) "with" @keyword.import)
; Namespaces ; Namespaces
(module_declaration (module_declaration
(identifier) @namespace) (identifier) @module)
; Builtins ; Builtins
@ -80,16 +80,16 @@
; Parameters ; Parameters
(parameter_declaration (parameter_declaration
(identifier) @parameter (identifier) @variable.parameter
(_)) (_))
(call_expression (call_expression
function: (_) function: (_)
(arguments (identifier) @parameter)) (arguments (identifier) @variable.parameter))
(call_expression (call_expression
function: (_) function: (_)
(arguments (member_expression object: (identifier) @parameter))) (arguments (member_expression object: (identifier) @variable.parameter)))
; Variables ; Variables
@ -118,16 +118,16 @@
; Conditionals ; Conditionals
"if" @conditional "if" @keyword.conditional
(ternary_expression (ternary_expression
"?" @conditional.ternary "?" @keyword.conditional.ternary
":" @conditional.ternary) ":" @keyword.conditional.ternary)
; Loops ; Loops
(for_statement (for_statement
"for" @repeat "for" @keyword.repeat
"in" "in"
":" @punctuation.delimiter) ":" @punctuation.delimiter)
@ -179,8 +179,8 @@
(string) @string (string) @string
(import_string (import_string
"'" @string "'" @string
(import_name) @namespace (import_name) @module
"@" @symbol "@" @string.special.symbol
(import_version) @string.special) (import_version) @string.special)
(escape_sequence) @string.escape (escape_sequence) @string.escape

View file

@ -6,7 +6,7 @@
"require" "require"
"export" "export"
"import" "import"
] @include ] @keyword.import
; Keywords ; Keywords
@ -37,16 +37,16 @@
(yield "from" @keyword.return) (yield "from" @keyword.return)
(future_import_statement (future_import_statement
"from" @include "from" @keyword.import
"__future__" @constant.builtin) "__future__" @constant.builtin)
(import_from_statement "from" @include) (import_from_statement "from" @keyword.import)
"import" @include "import" @keyword.import
(aliased_import "as" @include) (aliased_import "as" @keyword.import)
["if" "elif" "else"] @conditional ["if" "elif" "else"] @keyword.conditional
["for" "while" "break" "continue"] @repeat ["for" "while" "break" "continue"] @keyword.repeat
[ [
"try" "try"
@ -54,13 +54,13 @@
"except*" "except*"
"raise" "raise"
"finally" "finally"
] @exception ] @keyword.exception
(raise_statement "from" @exception) (raise_statement "from" @keyword.exception)
(try_statement (try_statement
(else_clause (else_clause
"else" @exception)) "else" @keyword.exception))
[ [
"addtask" "addtask"
@ -73,7 +73,7 @@
[ [
"before" "before"
"after" "after"
] @storageclass ] @keyword.storage
[ [
"append" "append"
@ -132,11 +132,11 @@
; Fields ; Fields
(flag) @field (flag) @variable.member
((attribute ((attribute
attribute: (python_identifier) @field) attribute: (python_identifier) @variable.member)
(#lua-match? @field "^[%l_].*$")) (#lua-match? @variable.member "^[%l_].*$"))
; Functions ; Functions
@ -145,7 +145,7 @@
(call (call
function: (attribute function: (attribute
attribute: (python_identifier) @method.call)) attribute: (python_identifier) @function.method.call))
((call ((call
function: (python_identifier) @constructor) function: (python_identifier) @constructor)
@ -200,34 +200,34 @@
; Namespace ; Namespace
(inherit_path) @namespace (inherit_path) @module
;; Normal parameters ;; Normal parameters
(parameters (parameters
(python_identifier) @parameter) (python_identifier) @variable.parameter)
;; Lambda parameters ;; Lambda parameters
(lambda_parameters (lambda_parameters
(python_identifier) @parameter) (python_identifier) @variable.parameter)
(lambda_parameters (lambda_parameters
(tuple_pattern (tuple_pattern
(python_identifier) @parameter)) (python_identifier) @variable.parameter))
; Default parameters ; Default parameters
(keyword_argument (keyword_argument
name: (python_identifier) @parameter) name: (python_identifier) @variable.parameter)
; Naming parameters on call-site ; Naming parameters on call-site
(default_parameter (default_parameter
name: (python_identifier) @parameter) name: (python_identifier) @variable.parameter)
(typed_parameter (typed_parameter
(python_identifier) @parameter) (python_identifier) @variable.parameter)
(typed_default_parameter (typed_default_parameter
(python_identifier) @parameter) (python_identifier) @variable.parameter)
; Variadic parameters *args, **kwargs ; Variadic parameters *args, **kwargs
(parameters (parameters
(list_splat_pattern ; *args (list_splat_pattern ; *args
(python_identifier) @parameter)) (python_identifier) @variable.parameter))
(parameters (parameters
(dictionary_splat_pattern ; **kwargs (dictionary_splat_pattern ; **kwargs
(python_identifier) @parameter)) (python_identifier) @variable.parameter))
;; Literals ;; Literals
@ -239,7 +239,7 @@
(#eq? @variable.builtin "cls")) (#eq? @variable.builtin "cls"))
(integer) @number (integer) @number
(float) @float (float) @number.float
; Operators ; Operators
@ -309,7 +309,7 @@
"\"" "\""
] @string ] @string
(include_path) @string.special (include_path) @string.special.path
[ [
(escape_sequence) (escape_sequence)

View file

@ -9,7 +9,7 @@
(boolean) @boolean (boolean) @boolean
(using) @include (using) @keyword.import
(template) @keyword (template) @keyword
@ -34,11 +34,11 @@
(template_definition (template_name_qualifier) @type.qualifier) (template_definition (template_name_qualifier) @type.qualifier)
(import_statement (gobject_library) @namespace) (import_statement (gobject_library) @module)
(import_statement (version_number) @float) (import_statement (version_number) @number.float)
(float) @float (float) @number.float
(number) @number (number) @number
[ [

View file

@ -1,4 +1,4 @@
; Lower priority to prefer @parameter when identifier appears in parameter_declaration. ; Lower priority to prefer @variable.parameter when identifier appears in parameter_declaration.
((identifier) @variable (#set! "priority" 95)) ((identifier) @variable (#set! "priority" 95))
(preproc_def (preproc_arg) @variable) (preproc_def (preproc_arg) @variable)
@ -27,14 +27,14 @@
"do" "do"
"continue" "continue"
"break" "break"
] @repeat ] @keyword.repeat
[ [
"if" "if"
"else" "else"
"case" "case"
"switch" "switch"
] @conditional ] @keyword.conditional
[ [
"#if" "#if"
@ -46,11 +46,11 @@
"#elifdef" "#elifdef"
"#elifndef" "#elifndef"
(preproc_directive) (preproc_directive)
] @preproc ] @keyword.directive
"#define" @define "#define" @keyword.directive.define
"#include" @include "#include" @keyword.import
[ ";" ":" "," "::" ] @punctuation.delimiter [ ";" ":" "," "::" ] @punctuation.delimiter
@ -111,7 +111,7 @@
(false) (false)
] @boolean ] @boolean
(conditional_expression [ "?" ":" ] @conditional.ternary) (conditional_expression [ "?" ":" ] @keyword.conditional.ternary)
(string_literal) @string (string_literal) @string
(system_lib_string) @string (system_lib_string) @string
@ -140,7 +140,7 @@
(type_descriptor) (type_descriptor)
] @type ] @type
(storage_class_specifier) @storageclass (storage_class_specifier) @keyword.storage
[ [
(type_qualifier) (type_qualifier)
@ -149,7 +149,7 @@
] @type.qualifier ] @type.qualifier
(linkage_specification (linkage_specification
"extern" @storageclass) "extern" @keyword.storage)
(type_definition (type_definition
declarator: (type_identifier) @type.definition) declarator: (type_identifier) @type.definition)
@ -236,13 +236,13 @@
;; Parameters ;; Parameters
(parameter_declaration (parameter_declaration
declarator: (identifier) @parameter) declarator: (identifier) @variable.parameter)
(parameter_declaration (parameter_declaration
declarator: (array_declarator) @parameter) declarator: (array_declarator) @variable.parameter)
(parameter_declaration (parameter_declaration
declarator: (pointer_declarator) @parameter) declarator: (pointer_declarator) @variable.parameter)
; K&R functions ; K&R functions
; To enable support for K&R functions, ; To enable support for K&R functions,
@ -250,24 +250,24 @@
; They are commented out as they'll conflict with C++ ; They are commented out as they'll conflict with C++
; Note that you'll need to have `; extends` at the top of your query file. ; Note that you'll need to have `; extends` at the top of your query file.
; ;
; (parameter_list (identifier) @parameter) ; (parameter_list (identifier) @variable.parameter)
; ;
; (function_definition ; (function_definition
; declarator: _ ; declarator: _
; (declaration ; (declaration
; declarator: (identifier) @parameter)) ; declarator: (identifier) @variable.parameter))
; ;
; (function_definition ; (function_definition
; declarator: _ ; declarator: _
; (declaration ; (declaration
; declarator: (array_declarator) @parameter)) ; declarator: (array_declarator) @variable.parameter))
; ;
; (function_definition ; (function_definition
; declarator: _ ; declarator: _
; (declaration ; (declaration
; declarator: (pointer_declarator) @parameter)) ; declarator: (pointer_declarator) @variable.parameter))
(preproc_params (identifier) @parameter) (preproc_params (identifier) @variable.parameter)
[ [
"__attribute__" "__attribute__"

View file

@ -5,10 +5,10 @@
(#has-ancestor? @keyword accessor_declaration)) (#has-ancestor? @keyword accessor_declaration))
(method_declaration (method_declaration
name: (identifier) @method) name: (identifier) @function.method)
(local_function_statement (local_function_statement
name: (identifier) @method) name: (identifier) @function.method)
(method_declaration (method_declaration
type: (identifier) @type) type: (identifier) @type)
@ -23,41 +23,41 @@
(invocation_expression (invocation_expression
(member_access_expression (member_access_expression
name: (identifier) @method.call)) name: (identifier) @function.method.call))
(invocation_expression (invocation_expression
function: (conditional_access_expression function: (conditional_access_expression
(member_binding_expression (member_binding_expression
name: (identifier) @method.call))) name: (identifier) @function.method.call)))
(namespace_declaration (namespace_declaration
name: [(qualified_name) (identifier)] @namespace) name: [(qualified_name) (identifier)] @module)
(qualified_name (qualified_name
(identifier) @type) (identifier) @type)
(invocation_expression (invocation_expression
(identifier) @method.call) (identifier) @function.method.call)
(field_declaration (field_declaration
(variable_declaration (variable_declaration
(variable_declarator (variable_declarator
(identifier) @field))) (identifier) @variable.member)))
(initializer_expression (initializer_expression
(assignment_expression (assignment_expression
left: (identifier) @field)) left: (identifier) @variable.member))
(parameter_list (parameter_list
(parameter (parameter
name: (identifier) @parameter)) name: (identifier) @variable.parameter))
(parameter_list (parameter_list
(parameter (parameter
type: (identifier) @type)) type: (identifier) @type))
(integer_literal) @number (integer_literal) @number
(real_literal) @float (real_literal) @number.float
(null_literal) @constant.builtin (null_literal) @constant.builtin
(character_literal) @character (character_literal) @character
@ -154,12 +154,12 @@
; Generic Method invocation with generic type ; Generic Method invocation with generic type
(invocation_expression (invocation_expression
function: (generic_name function: (generic_name
. (identifier) @method.call)) . (identifier) @function.method.call))
(invocation_expression (invocation_expression
(member_access_expression (member_access_expression
(generic_name (generic_name
(identifier) @method))) (identifier) @function.method)))
(base_list (base_list
(identifier) @type) (identifier) @type)
@ -194,10 +194,10 @@
(identifier) @type) (identifier) @type)
(name_colon (name_colon
(identifier) @parameter) (identifier) @variable.parameter)
(warning_directive) @text.warning (warning_directive) @comment.warning
(error_directive) @exception (error_directive) @keyword.exception
(define_directive (define_directive
(identifier) @constant) @constant.macro (identifier) @constant) @constant.macro
@ -231,7 +231,7 @@
(elif_directive) (elif_directive)
(else_directive) (else_directive)
(endif_directive) (endif_directive)
] @conditional ] @keyword.conditional
(if_directive (if_directive
(identifier) @constant) (identifier) @constant)
@ -245,14 +245,14 @@
"continue" "continue"
"goto" "goto"
"foreach" "foreach"
] @repeat ] @keyword.repeat
[ [
"try" "try"
"catch" "catch"
"throw" "throw"
"finally" "finally"
] @exception ] @keyword.exception
[ [
"+" "+"
@ -304,7 +304,7 @@
":" ":"
] @punctuation.delimiter ] @punctuation.delimiter
(conditional_expression ["?" ":"] @conditional.ternary) (conditional_expression ["?" ":"] @keyword.conditional.ternary)
[ [
"[" "["
@ -325,10 +325,10 @@
[ [
"using" "using"
"as" "as"
] @include ] @keyword.import
(alias_qualified_name (alias_qualified_name
(identifier "global") @include) (identifier "global") @keyword.import)
[ [
"with" "with"
@ -385,7 +385,7 @@
"static" "static"
"volatile" "volatile"
"required" "required"
] @storageclass ] @keyword.storage
[ [
"abstract" "abstract"

View file

@ -3,17 +3,17 @@
[ [
"%builtins" "%builtins"
"%lang" "%lang"
] @preproc ] @keyword.directive
; Includes ; Includes
(import_statement [ "from" "import" ] @include module_name: (dotted_name (identifier) @namespace . )) (import_statement [ "from" "import" ] @keyword.import module_name: (dotted_name (identifier) @module . ))
[ [
"as" "as"
"use" "use"
"mod" "mod"
] @include ] @keyword.import
; Variables ; Variables
@ -21,24 +21,24 @@
; Namespaces ; Namespaces
(namespace_definition (identifier) @namespace) (namespace_definition (identifier) @module)
(mod_item (mod_item
name: (identifier) @namespace) name: (identifier) @module)
(use_list (self) @namespace) (use_list (self) @module)
(scoped_use_list (self) @namespace) (scoped_use_list (self) @module)
(scoped_identifier (scoped_identifier
path: (identifier) @namespace) path: (identifier) @module)
(scoped_identifier (scoped_identifier
(scoped_identifier (scoped_identifier
name: (identifier) @namespace)) name: (identifier) @module))
(scoped_type_identifier (scoped_type_identifier
path: (identifier) @namespace) path: (identifier) @module)
((scoped_identifier ((scoped_identifier
path: (identifier) @type) path: (identifier) @type)
@ -65,13 +65,13 @@
(#lua-match? @constant "^[A-Z]")) (#lua-match? @constant "^[A-Z]"))
(scoped_use_list (scoped_use_list
path: (identifier) @namespace) path: (identifier) @module)
(scoped_use_list (scoped_use_list
path: (scoped_identifier path: (scoped_identifier
(identifier) @namespace)) (identifier) @module))
(use_list (scoped_identifier (identifier) @namespace . (_))) (use_list (scoped_identifier (identifier) @module . (_)))
(use_list (identifier) @type (#lua-match? @type "^[A-Z]")) (use_list (identifier) @type (#lua-match? @type "^[A-Z]"))
@ -125,47 +125,47 @@
[ [
"tempvar" "tempvar"
"extern" "extern"
] @storageclass ] @keyword.storage
[ [
"if" "if"
"else" "else"
"match" "match"
] @conditional ] @keyword.conditional
[ [
"loop" "loop"
] @repeat ] @keyword.repeat
[ [
"assert" "assert"
"static_assert" "static_assert"
"nopanic" "nopanic"
] @exception ] @keyword.exception
; Fields ; Fields
(implicit_arguments (typed_identifier (identifier) @field)) (implicit_arguments (typed_identifier (identifier) @variable.member))
(member_expression "." (identifier) @field) (member_expression "." (identifier) @variable.member)
(call_expression (assignment_expression left: (identifier) @field)) (call_expression (assignment_expression left: (identifier) @variable.member))
(tuple_expression (assignment_expression left: (identifier) @field)) (tuple_expression (assignment_expression left: (identifier) @variable.member))
(field_identifier) @field (field_identifier) @variable.member
(shorthand_field_initializer (identifier) @field) (shorthand_field_initializer (identifier) @variable.member)
; Parameters ; Parameters
(arguments (typed_identifier (identifier) @parameter)) (arguments (typed_identifier (identifier) @variable.parameter))
(call_expression (tuple_expression (assignment_expression left: (identifier) @parameter))) (call_expression (tuple_expression (assignment_expression left: (identifier) @variable.parameter)))
(return_type (tuple_type (named_type . (identifier) @parameter))) (return_type (tuple_type (named_type . (identifier) @variable.parameter)))
(parameter (identifier) @parameter) (parameter (identifier) @variable.parameter)
; Builtins ; Builtins
@ -202,7 +202,7 @@
; Types ; Types
(struct_definition . (identifier) @type (typed_identifier (identifier) @field)?) (struct_definition . (identifier) @type (typed_identifier (identifier) @variable.member)?)
(named_type (identifier) @type .) (named_type (identifier) @type .)

View file

@ -3,7 +3,7 @@
[ [
(unique_id) (unique_id)
(top_level_annotation_body) (top_level_annotation_body)
] @preproc ] @keyword.directive
; Includes ; Includes
@ -12,9 +12,9 @@
"$import" "$import"
"embed" "embed"
"using" "using"
] @include ] @keyword.import
(import_path) @string @text.uri (import_path) @string.special.path
; Keywords ; Keywords
@ -53,11 +53,11 @@
[ [
(annotation_definition_identifier) (annotation_definition_identifier)
(method_identifier) (method_identifier)
] @method ] @function.method
; Fields ; Fields
(field_identifier) @field (field_identifier) @variable.member
; Properties ; Properties
@ -68,9 +68,9 @@
[ [
(param_identifier) (param_identifier)
(return_identifier) (return_identifier)
] @parameter ] @variable.parameter
(annotation_target) @parameter.builtin (annotation_target) @variable.parameter.builtin
; Constants ; Constants
@ -110,7 +110,7 @@
(namespace) (namespace)
] @string ] @string
(namespace) @text.underline (namespace) @string.special
(escape_sequence) @string.escape (escape_sequence) @string.escape
@ -118,11 +118,11 @@
(number) @number (number) @number
(float) @float (float) @number.float
(boolean) @boolean (boolean) @boolean
(data_hex) @symbol (data_hex) @string.special.symbol
; Punctuation ; Punctuation

View file

@ -12,14 +12,14 @@
[":" ","] @punctuation.delimiter [":" ","] @punctuation.delimiter
(["\"" "'"] @punctuation.special @conceal (["\"" "'"] @punctuation.special
(#set! conceal "")) (#set! conceal ""))
["%" "?" "#"] @character.special ["%" "?" "#"] @character.special
;; Entities ;; Entities
(intent) @namespace (intent) @module
(slot) @type (slot) @type
@ -37,13 +37,13 @@
;; Import ;; Import
"import" @include "import" @keyword.import
(file) @string.special (file) @string.special.path
;; Text ;; Text
(word) @text @spell (word) @spell
;; Comment ;; Comment

View file

@ -17,14 +17,14 @@
(dis_expr) @comment (dis_expr) @comment
(#set! "priority" 105) ; Higher priority to mark the whole sexpr as a comment (#set! "priority" 105) ; Higher priority to mark the whole sexpr as a comment
) )
(kwd_lit) @symbol (kwd_lit) @string.special.symbol
(str_lit) @string (str_lit) @string
(num_lit) @number (num_lit) @number
(char_lit) @character (char_lit) @character
(bool_lit) @boolean (bool_lit) @boolean
(nil_lit) @constant.builtin (nil_lit) @constant.builtin
(comment) @comment @spell (comment) @comment @spell
(regex_lit) @string.regex (regex_lit) @string.regexp
["'" "`"] @string.escape ["'" "`"] @string.escape
@ -49,13 +49,13 @@
; Quoted symbols ; Quoted symbols
(quoting_lit (quoting_lit
(sym_lit) @symbol) (sym_lit) @string.special.symbol)
(syn_quoting_lit (syn_quoting_lit
(sym_lit) @symbol) (sym_lit) @string.special.symbol)
; Used in destructure pattern ; Used in destructure pattern
((sym_lit) @parameter ((sym_lit) @variable.parameter
(#lua-match? @parameter "^[&]")) (#lua-match? @variable.parameter "^[&]"))
; Inline function variables ; Inline function variables
((sym_lit) @variable.builtin ((sym_lit) @variable.builtin
@ -102,19 +102,19 @@
; Interop ; Interop
; (.instanceMember instance args*) ; (.instanceMember instance args*)
; (.instanceMember Classname args*) ; (.instanceMember Classname args*)
((sym_lit) @method ((sym_lit) @function.method
(#lua-match? @method "^%.[^-]")) (#lua-match? @function.method "^%.[^-]"))
; (.-instanceField instance) ; (.-instanceField instance)
((sym_lit) @field ((sym_lit) @variable.member
(#lua-match? @field "^%.%-.*")) (#lua-match? @variable.member "^%.%-.*"))
; Classname/staticField ; Classname/staticField
((sym_lit) @field ((sym_lit) @variable.member
(#lua-match? @field "^[%u].*/.+")) (#lua-match? @variable.member "^[%u].*/.+"))
; (Classname/staticMethod args*) ; (Classname/staticMethod args*)
(list_lit (list_lit
. .
(sym_lit) @method (sym_lit) @function.method
(#lua-match? @method "^[%u].*/.+")) (#lua-match? @function.method "^[%u].*/.+"))
;; TODO: Special casing for the `.` macro ;; TODO: Special casing for the `.` macro
; Operators ; Operators
@ -145,29 +145,29 @@
(#any-of? @comment "comment")) (#any-of? @comment "comment"))
; Conditionals ; Conditionals
((sym_lit) @conditional ((sym_lit) @keyword.conditional
(#any-of? @conditional (#any-of? @keyword.conditional
"case" "cond" "cond->" "cond->>" "condp")) "case" "cond" "cond->" "cond->>" "condp"))
((sym_lit) @conditional ((sym_lit) @keyword.conditional
(#any-of? @conditional (#any-of? @keyword.conditional
"if" "if-let" "if-not" "if-some")) "if" "if-let" "if-not" "if-some"))
((sym_lit) @conditional ((sym_lit) @keyword.conditional
(#any-of? @conditional (#any-of? @keyword.conditional
"when" "when-first" "when-let" "when-not" "when-some")) "when" "when-first" "when-let" "when-not" "when-some"))
; Repeats ; Repeats
((sym_lit) @repeat ((sym_lit) @keyword.repeat
(#any-of? @repeat (#any-of? @keyword.repeat
"doseq" "dotimes" "for" "loop" "recur" "while")) "doseq" "dotimes" "for" "loop" "recur" "while"))
; Exception ; Exception
((sym_lit) @exception ((sym_lit) @keyword.exception
(#any-of? @exception (#any-of? @keyword.exception
"throw" "try" "catch" "finally")) "throw" "try" "catch" "finally"))
; Includes ; Includes
((sym_lit) @include ((sym_lit) @keyword.import
(#any-of? @include "ns" "import" "require" "use")) (#any-of? @keyword.import "ns" "import" "require" "use"))
; Builtin macros ; Builtin macros
;; TODO: Do all these items belong here? ;; TODO: Do all these items belong here?
@ -350,18 +350,18 @@
;; TODO: Reproduce bug and file ticket ;; TODO: Reproduce bug and file ticket
;. ;.
;[(vec_lit ;[(vec_lit
; (sym_lit)* @parameter) ; (sym_lit)* @variable.parameter)
; (list_lit ; (list_lit
; (vec_lit ; (vec_lit
; (sym_lit)* @parameter))]) ; (sym_lit)* @variable.parameter))])
;[((list_lit ;[((list_lit
; (vec_lit ; (vec_lit
; (sym_lit) @parameter) ; (sym_lit) @variable.parameter)
; (_) ; (_)
; + ; +
; ((vec_lit ; ((vec_lit
; (sym_lit) @parameter) ; (sym_lit) @variable.parameter)
; (_))) ; (_)))
@ -378,4 +378,4 @@
(sym_lit) @_include (sym_lit) @_include
(#eq? @_include "ns") (#eq? @_include "ns")
. .
(sym_lit) @namespace) (sym_lit) @module)

View file

@ -21,7 +21,7 @@
(normal_command (identifier) @function) (normal_command (identifier) @function)
["ENV" "CACHE"] @storageclass ["ENV" "CACHE"] @keyword.storage
["$" "{" "}" "<" ">"] @punctuation.special ["$" "{" "}" "<" ">"] @punctuation.special
["(" ")"] @punctuation.bracket ["(" ")"] @punctuation.bracket
@ -37,18 +37,18 @@
(elseif) (elseif)
(else) (else)
(endif) (endif)
] @conditional ] @keyword.conditional
[ [
(foreach) (foreach)
(endforeach) (endforeach)
(while) (while)
(endwhile) (endwhile)
] @repeat ] @keyword.repeat
(normal_command (normal_command
(identifier) @repeat (identifier) @keyword.repeat
(#match? @repeat "\\c^(continue|break)$") (#match? @keyword.repeat "\\c^(continue|break)$")
) )
(normal_command (normal_command
(identifier) @keyword.return (identifier) @keyword.return
@ -59,7 +59,7 @@
(function) (function)
(argument_list (argument_list
. (argument) @function . (argument) @function
(argument)* @parameter (argument)* @variable.parameter
) )
) )
@ -67,7 +67,7 @@
(macro) (macro)
(argument_list (argument_list
. (argument) @function.macro . (argument) @function.macro
(argument)* @parameter (argument)* @variable.parameter
) )
) )
@ -134,7 +134,7 @@
(argument_list (argument_list
. (argument) . (argument)
( (
(argument) @_cache @storageclass (argument) @_cache @keyword.storage
. .
(argument) @_type @type (argument) @_type @type
(#any-of? @_cache "CACHE") (#any-of? @_cache "CACHE")
@ -148,8 +148,8 @@
(#match? @_function "\\c^unset$") (#match? @_function "\\c^unset$")
(argument_list (argument_list
. (argument) . (argument)
(argument) @storageclass (argument) @keyword.storage
(#any-of? @storageclass "CACHE" "PARENT_SCOPE") (#any-of? @keyword.storage "CACHE" "PARENT_SCOPE")
) )
) )
@ -213,5 +213,5 @@
(escape_sequence) @string.escape (escape_sequence) @string.escape
((source_file . (line_comment) @preproc) ((source_file . (line_comment) @keyword.directive)
(#lua-match? @preproc "^#!/")) (#lua-match? @keyword.directive "^#!/"))

View file

@ -1,41 +1,43 @@
((tag ((tag
(name) @text.todo @nospell (name) @comment.todo @nospell
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? ("(" @punctuation.bracket
(user) @constant
")" @punctuation.bracket)?
":" @punctuation.delimiter) ":" @punctuation.delimiter)
(#any-of? @text.todo "TODO" "WIP")) (#any-of? @comment.todo "TODO" "WIP"))
("text" @text.todo @nospell ("text" @comment.todo @nospell
(#any-of? @text.todo "TODO" "WIP")) (#any-of? @comment.todo "TODO" "WIP"))
((tag ((tag
(name) @text.note @nospell (name) @comment.note @nospell
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
":" @punctuation.delimiter) ":" @punctuation.delimiter)
(#any-of? @text.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST")) (#any-of? @comment.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST"))
("text" @text.note @nospell ("text" @comment.note @nospell
(#any-of? @text.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST")) (#any-of? @comment.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST"))
((tag ((tag
(name) @text.warning @nospell (name) @comment.warning @nospell
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
":" @punctuation.delimiter) ":" @punctuation.delimiter)
(#any-of? @text.warning "HACK" "WARNING" "WARN" "FIX")) (#any-of? @comment.warning "HACK" "WARNING" "WARN" "FIX"))
("text" @text.warning @nospell ("text" @comment.warning @nospell
(#any-of? @text.warning "HACK" "WARNING" "WARN" "FIX")) (#any-of? @comment.warning "HACK" "WARNING" "WARN" "FIX"))
((tag ((tag
(name) @text.danger @nospell (name) @comment.error @nospell
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
":" @punctuation.delimiter) ":" @punctuation.delimiter)
(#any-of? @text.danger "FIXME" "BUG" "ERROR")) (#any-of? @comment.error "FIXME" "BUG" "ERROR"))
("text" @text.danger @nospell ("text" @comment.error @nospell
(#any-of? @text.danger "FIXME" "BUG" "ERROR")) (#any-of? @comment.error "FIXME" "BUG" "ERROR"))
; Issue number (#123) ; Issue number (#123)
("text" @number ("text" @number
(#lua-match? @number "^#[0-9]+$")) (#lua-match? @number "^#[0-9]+$"))
((uri) @text.uri @nospell) ((uri) @string.special.url @nospell)

View file

@ -10,14 +10,14 @@
(defun_header (defun_header
function_name: (_) @function) function_name: (_) @function)
(defun_header (defun_header
lambda_list: (list_lit (sym_lit) @parameter)) lambda_list: (list_lit (sym_lit) @variable.parameter))
(defun_header (defun_header
keyword: (defun_keyword "defmethod") keyword: (defun_keyword "defmethod")
lambda_list: (list_lit (list_lit . (sym_lit) . (sym_lit) @symbol))) lambda_list: (list_lit (list_lit . (sym_lit) . (sym_lit) @string.special.symbol)))
(defun_header (defun_header
lambda_list: (list_lit (list_lit . (sym_lit) @parameter . (_)))) lambda_list: (list_lit (list_lit . (sym_lit) @variable.parameter . (_))))
(defun_header (defun_header
specifier: (sym_lit) @symbol) specifier: (sym_lit) @string.special.symbol)
[":" "::" "."] @punctuation.special [":" "::" "."] @punctuation.special
@ -51,14 +51,14 @@
] @function.macro ] @function.macro
"=" @operator "=" @operator
(include_reader_macro) @symbol (include_reader_macro) @string.special.symbol
["#C" "#c"] @number ["#C" "#c"] @number
[(kwd_lit) (self_referential_reader_macro)] @symbol [(kwd_lit) (self_referential_reader_macro)] @string.special.symbol
(package_lit (package_lit
package: (_) @namespace) package: (_) @module)
"cl" @namespace "cl" @module
(str_lit) @string (str_lit) @string
@ -119,10 +119,10 @@
(#lua-match? @constant "^[+].+[+]$")) (#lua-match? @constant "^[+].+[+]$"))
(var_quoting_lit (var_quoting_lit
marker: "#'" @symbol marker: "#'" @string.special.symbol
value: (_) @symbol) value: (_) @string.special.symbol)
["#" "#p" "#P"] @symbol ["#" "#p" "#P"] @string.special.symbol
(list_lit (list_lit
. .
@ -137,8 +137,8 @@
(#match? @operator "^([+*-+=<>]|<=|>=|/=)$")) (#match? @operator "^([+*-+=<>]|<=|>=|/=)$"))
((sym_lit) @symbol ((sym_lit) @string.special.symbol
(#lua-match? @symbol "^[&]")) (#lua-match? @string.special.symbol "^[&]"))
[(array_dimension) "#0A" "#0a"] @number [(array_dimension) "#0A" "#0a"] @number

View file

@ -2,21 +2,21 @@
(ingredient (ingredient
"@" @tag "@" @tag
(name)? @text.title (name)? @markup.heading
(amount (amount
(quantity)? @number (quantity)? @number
(units)? @tag.attribute)?) (units)? @tag.attribute)?)
(timer (timer
"~" @tag "~" @tag
(name)? @text.title (name)? @markup.heading
(amount (amount
(quantity)? @number (quantity)? @number
(units)? @tag.attribute)?) (units)? @tag.attribute)?)
(cookware (cookware
"#" @tag "#" @tag
(name)? @text.title (name)? @markup.heading
(amount (amount
(quantity)? @number (quantity)? @number
(units)? @tag.attribute)?) (units)? @tag.attribute)?)

View file

@ -15,6 +15,6 @@
(string) @string (string) @string
(integer) @number (integer) @number
(float) @float (float) @number.float
(boolean) @boolean (boolean) @boolean
(null) @keyword (null) @keyword

View file

@ -19,7 +19,7 @@
(number) @number (number) @number
(float) @float (float) @number.float
(boolean) @boolean (boolean) @boolean
@ -38,7 +38,7 @@
[ "<" ">" ] @punctuation.bracket [ "<" ">" ] @punctuation.bracket
(("\"" @conceal) (("\"" @string)
(#set! conceal "")) (#set! conceal ""))
; Comments ; Comments

View file

@ -1,33 +1,33 @@
; inherits: c ; inherits: c
((identifier) @field ((identifier) @variable.member
(#lua-match? @field "^m_.*$")) (#lua-match? @variable.member "^m_.*$"))
(parameter_declaration (parameter_declaration
declarator: (reference_declarator) @parameter) declarator: (reference_declarator) @variable.parameter)
; function(Foo ...foo) ; function(Foo ...foo)
(variadic_parameter_declaration (variadic_parameter_declaration
declarator: (variadic_declarator declarator: (variadic_declarator
(_) @parameter)) (_) @variable.parameter))
; int foo = 0 ; int foo = 0
(optional_parameter_declaration (optional_parameter_declaration
declarator: (_) @parameter) declarator: (_) @variable.parameter)
;(field_expression) @parameter ;; How to highlight this? ;(field_expression) @variable.parameter ;; How to highlight this?
(((field_expression (((field_expression
(field_identifier) @method)) @_parent (field_identifier) @function.method)) @_parent
(#has-parent? @_parent template_method function_declarator)) (#has-parent? @_parent template_method function_declarator))
(field_declaration (field_declaration
(field_identifier) @field) (field_identifier) @variable.member)
(field_initializer (field_initializer
(field_identifier) @property) (field_identifier) @property)
(function_declarator (function_declarator
declarator: (field_identifier) @method) declarator: (field_identifier) @function.method)
(concept_definition (concept_definition
name: (identifier) @type.definition) name: (identifier) @type.definition)
@ -37,17 +37,17 @@
(auto) @type.builtin (auto) @type.builtin
(namespace_identifier) @namespace (namespace_identifier) @module
((namespace_identifier) @type ((namespace_identifier) @type
(#lua-match? @type "^[%u]")) (#lua-match? @type "^[%u]"))
(case_statement (case_statement
value: (qualified_identifier (identifier) @constant)) value: (qualified_identifier (identifier) @constant))
(using_declaration . "using" . "namespace" . [(qualified_identifier) (identifier)] @namespace) (using_declaration . "using" . "namespace" . [(qualified_identifier) (identifier)] @module)
(destructor_name (destructor_name
(identifier) @method) (identifier) @function.method)
; functions ; functions
(function_declarator (function_declarator
@ -125,10 +125,10 @@
; methods ; methods
(function_declarator (function_declarator
(template_method (template_method
(field_identifier) @method)) (field_identifier) @function.method))
(call_expression (call_expression
(field_expression (field_expression
(field_identifier) @method.call)) (field_identifier) @function.method.call))
; constructors ; constructors
@ -176,7 +176,7 @@
"catch" "catch"
"noexcept" "noexcept"
"throw" "throw"
] @exception ] @keyword.exception
[ [

View file

@ -9,7 +9,7 @@
(from) (from)
] @keyword ] @keyword
"@import" @include "@import" @keyword.import
(comment) @comment @spell (comment) @comment @spell
@ -57,7 +57,7 @@
(attribute_name) (attribute_name)
] @property ] @property
(namespace_name) @namespace (namespace_name) @module
((property_name) @type.definition ((property_name) @type.definition
(#lua-match? @type.definition "^[-][-]")) (#lua-match? @type.definition "^[-][-]"))

View file

@ -8,6 +8,6 @@
"__global__" "__global__"
"__forceinline__" "__forceinline__"
"__noinline__" "__noinline__"
] @storageclass ] @keyword.storage
"__launch_bounds__" @type.qualifier "__launch_bounds__" @type.qualifier

View file

@ -3,18 +3,18 @@
[ [
"package" "package"
"import" "import"
] @include ] @keyword.import
; Namespaces ; Namespaces
(package_identifier) @namespace (package_identifier) @module
(import_spec ["." "_"] @punctuation.special) (import_spec ["." "_"] @punctuation.special)
[ [
(attr_path) (attr_path)
(package_path) (package_path)
] @text.uri ;; In attributes ] @string.special.url ;; In attributes
; Attributes ; Attributes
@ -22,13 +22,13 @@
; Conditionals ; Conditionals
"if" @conditional "if" @keyword.conditional
; Repeats ; Repeats
[ [
"for" "for"
] @repeat ] @keyword.repeat
(for_clause "_" @punctuation.special) (for_clause "_" @punctuation.special)
@ -69,7 +69,7 @@
(field (field
(label (label
(identifier) @field)) (identifier) @variable.member))
(selector_expression (selector_expression
(_) (_)
@ -135,11 +135,11 @@
(number) @number (number) @number
(float) @float (float) @number.float
(si_unit (si_unit
(float) (float)
(_) @symbol) (_) @string.special.symbol)
(boolean) @boolean (boolean) @boolean

View file

@ -59,7 +59,7 @@
(integer_literal) @number (integer_literal) @number
(float_literal) @float (float_literal) @number.float
[ [
"true" "true"
@ -88,12 +88,12 @@
(parameter (parameter
(var_declarator (var_declarator
(identifier) @parameter (identifier) @variable.parameter
) )
) )
(function_literal (function_literal
(identifier) @parameter (identifier) @variable.parameter
) )
(constructor (constructor
@ -112,7 +112,7 @@
"else" "else"
"if" "if"
"switch" "switch"
] @conditional ] @keyword.conditional
[ [
"break" "break"
@ -122,7 +122,7 @@
"foreach" "foreach"
"foreach_reverse" "foreach_reverse"
"while" "while"
] @repeat ] @keyword.repeat
[ [
"__parameters" "__parameters"
@ -209,7 +209,7 @@
"finally" "finally"
"throw" "throw"
"try" "try"
] @exception ] @keyword.exception
"null" @constant.builtin "null" @constant.builtin
@ -218,7 +218,7 @@
"const" "const"
"immutable" "immutable"
"shared" "shared"
] @storageclass ] @keyword.storage
[ [
"abstract" "abstract"
@ -241,11 +241,11 @@
. (identifier) @type.definition) . (identifier) @type.definition)
(module_declaration (module_declaration
"module" @include "module" @keyword.import
) )
(import_declaration (import_declaration
"import" @include "import" @keyword.import
) )
(type) @type (type) @type
@ -272,8 +272,8 @@
(fundamental_type) @type.builtin (fundamental_type) @type.builtin
(module_fully_qualified_name (packages (package_name) @namespace)) (module_fully_qualified_name (packages (package_name) @module))
(module_name) @namespace (module_name) @module
(at_attribute) @attribute (at_attribute) @attribute

View file

@ -84,11 +84,11 @@
(scoped_identifier (scoped_identifier
scope: (identifier) @type) scope: (identifier) @type)
(function_signature (function_signature
name: (identifier) @method) name: (identifier) @function.method)
(getter_signature (getter_signature
(identifier) @method) (identifier) @function.method)
(setter_signature (setter_signature
name: (identifier) @method) name: (identifier) @function.method)
(enum_declaration (enum_declaration
name: (identifier) @type) name: (identifier) @type)
(enum_constant (enum_constant
@ -131,10 +131,10 @@
; Parameters ; Parameters
; -------------------- ; --------------------
(formal_parameter (formal_parameter
name: (identifier) @parameter) name: (identifier) @variable.parameter)
(named_argument (named_argument
(label (identifier) @parameter)) (label (identifier) @variable.parameter))
; Literals ; Literals
; -------------------- ; --------------------
@ -147,7 +147,7 @@
; (hex_floating_point_literal) ; (hex_floating_point_literal)
] @number ] @number
(symbol_literal) @symbol (symbol_literal) @string.special.symbol
(string_literal) @string (string_literal) @string
(true) @boolean (true) @boolean
(false) @boolean (false) @boolean
@ -165,7 +165,7 @@
"as" "as"
"show" "show"
"hide" "hide"
] @include ] @keyword.import
; Reserved words (cannot be used as identifiers) ; Reserved words (cannot be used as identifiers)
[ [
@ -257,7 +257,7 @@
"static" "static"
"typedef")) "typedef"))
["if" "else" "switch" "default"] @conditional ["if" "else" "switch" "default"] @keyword.conditional
[ [
"try" "try"
@ -265,6 +265,6 @@
"catch" "catch"
"finally" "finally"
(break_statement) (break_statement)
] @exception ] @keyword.exception
["do" "while" "continue" "for"] @repeat ["do" "while" "continue" "for"] @keyword.repeat

View file

@ -3,7 +3,7 @@
[ [
(preproc_include) (preproc_include)
(dtsi_include) (dtsi_include)
] @include ] @keyword.import
(preproc_def) @constant.macro (preproc_def) @constant.macro
(preproc_function_def) @function.macro (preproc_function_def) @function.macro
@ -22,7 +22,7 @@
(integer_literal) @number (integer_literal) @number
(identifier) @variable (identifier) @variable
(node (identifier) @namespace) (node (identifier) @module)
(property (identifier) @property) (property (identifier) @property)
(labeled_item (identifier) @label) (labeled_item (identifier) @label)
(call_expression (identifier) @function.macro) (call_expression (identifier) @function.macro)

View file

@ -2,11 +2,11 @@
;; Imports ;; Imports
(missing_import) @include (missing_import) @keyword.import
(local_import) @string.special.path (local_import) @string.special.path
(http_import) @string @text.uri (http_import) @string.special.url
[ [
(env_variable) (env_variable)
@ -29,7 +29,7 @@
;; Parameters ;; Parameters
(lambda_expression label: (label) @parameter) (lambda_expression label: (label) @variable.parameter)
;; Variables ;; Variables
@ -44,13 +44,13 @@
; Fields ; Fields
(record_literal_entry (label) @field) (record_literal_entry (label) @variable.member)
(record_type_entry (label) @field) (record_type_entry (label) @variable.member)
(selector (selector
(selector_dot) (selector_dot)
(_) @field) (_) @variable.member)
;; Keywords ;; Keywords
@ -141,7 +141,7 @@
"if" "if"
"then" "then"
"else" "else"
] @conditional ] @keyword.conditional
;; Literals ;; Literals
@ -157,7 +157,7 @@
(natural_literal) (natural_literal)
] @number ] @number
(double_literal) @float (double_literal) @number.float
(boolean_literal) @boolean (boolean_literal) @boolean

View file

@ -1,5 +1,5 @@
[(addition) (new_file)] @text.diff.add [(addition) (new_file)] @diff.plus
[(deletion) (old_file)] @text.diff.delete [(deletion) (old_file)] @diff.minus
(commit) @constant (commit) @constant
(location) @attribute (location) @attribute

View file

@ -33,12 +33,12 @@
(subgraph (subgraph
id: (id id: (id
(identifier) @namespace) (identifier) @module)
) )
(attribute (attribute
name: (id name: (id
(identifier) @field) (identifier) @variable.member)
) )
(attribute (attribute
@ -48,6 +48,6 @@
(comment) @comment (comment) @comment
(preproc) @preproc (preproc) @keyword.directive
(comment) @spell (comment) @spell

View file

@ -10,14 +10,14 @@
((tag ((tag
(tag_name) @_param (tag_name) @_param
(identifier) @parameter) (identifier) @variable.parameter)
(#any-of? @_param "@param" "\\param")) (#any-of? @_param "@param" "\\param"))
(function (identifier) @function) (function (identifier) @function)
(function_link) @function (function_link) @function
(emphasis) @text.emphasis (emphasis) @markup.italic
[ [
"\\a" "\\a"
@ -30,7 +30,7 @@
"in" "in"
"out" "out"
"inout" "inout"
] @storageclass ] @keyword.storage
"~" @operator "~" @operator

View file

@ -1,6 +1,6 @@
;; XML declaration ;; XML declaration
(XMLDecl "xml" @preproc) (XMLDecl "xml" @keyword.directive)
(XMLDecl [ "version" "encoding" ] @tag.attribute) (XMLDecl [ "version" "encoding" ] @tag.attribute)
@ -10,12 +10,12 @@
;; Processing instructions ;; Processing instructions
(PI) @preproc (PI) @keyword.directive
;; Element declaration ;; Element declaration
(elementdecl (elementdecl
"ELEMENT" @define "ELEMENT" @keyword.directive.define
(Name) @tag) (Name) @tag)
(contentspec (contentspec
@ -30,7 +30,7 @@
;; Entity declaration ;; Entity declaration
(GEDecl (GEDecl
"ENTITY" @define "ENTITY" @keyword.directive.define
(Name) @constant) (Name) @constant)
(GEDecl (EntityValue) @string) (GEDecl (EntityValue) @string)
@ -42,7 +42,7 @@
;; Parsed entity declaration ;; Parsed entity declaration
(PEDecl (PEDecl
"ENTITY" @define "ENTITY" @keyword.directive.define
"%" @operator "%" @operator
(Name) @function.macro) (Name) @function.macro)
@ -51,18 +51,18 @@
;; Notation declaration ;; Notation declaration
(NotationDecl (NotationDecl
"NOTATION" @preproc "NOTATION" @keyword.directive
(Name) @label) (Name) @label)
((NotationDecl ((NotationDecl
(ExternalID (ExternalID
(SystemLiteral (URI) @string.special)) (SystemLiteral (URI) @string.special.url))
(#set! "priority" 105))) (#set! "priority" 105)))
;; Attlist declaration ;; Attlist declaration
(AttlistDecl (AttlistDecl
"ATTLIST" @define "ATTLIST" @keyword.directive.define
(Name) @tag) (Name) @tag)
(AttDef (Name) @tag.attribute) (AttDef (Name) @tag.attribute)
@ -100,7 +100,7 @@
(PubidLiteral) @string.special (PubidLiteral) @string.special
(SystemLiteral (URI) @text.uri) (SystemLiteral (URI) @string.special.url)
;; Delimiters & punctuation ;; Delimiters & punctuation
@ -114,6 +114,6 @@
;; Misc ;; Misc
[ "INCLUDE" "IGNORE" ] @include [ "INCLUDE" "IGNORE" ] @keyword.import
(Comment) @comment @spell (Comment) @comment @spell

View file

@ -13,8 +13,8 @@
((identifier) @type ((identifier) @type
(#lua-match? @type "^%u")) (#lua-match? @type "^%u"))
((identifier) @symbol ((identifier) @string.special.symbol
(#lua-match? @symbol "^%l")) (#lua-match? @string.special.symbol "^%l"))
((identifier) @constant ((identifier) @constant
(#lua-match? @constant "^%u[%u%d_]+$")) (#lua-match? @constant "^%u[%u%d_]+$"))

View file

@ -86,25 +86,25 @@
(generator_function_declaration (generator_function_declaration
name: (identifier) @function) name: (identifier) @function)
(method_definition (method_definition
name: [(property_identifier) (private_property_identifier)] @method) name: [(property_identifier) (private_property_identifier)] @function.method)
(method_definition (method_definition
name: (property_identifier) @constructor name: (property_identifier) @constructor
(#eq? @constructor "constructor")) (#eq? @constructor "constructor"))
(pair (pair
key: (property_identifier) @method key: (property_identifier) @function.method
value: (function)) value: (function))
(pair (pair
key: (property_identifier) @method key: (property_identifier) @function.method
value: (arrow_function)) value: (arrow_function))
(assignment_expression (assignment_expression
left: (member_expression left: (member_expression
property: (property_identifier) @method) property: (property_identifier) @function.method)
right: (arrow_function)) right: (arrow_function))
(assignment_expression (assignment_expression
left: (member_expression left: (member_expression
property: (property_identifier) @method) property: (property_identifier) @function.method)
right: (function)) right: (function))
(variable_declarator (variable_declarator
@ -129,13 +129,13 @@
(call_expression (call_expression
function: (member_expression function: (member_expression
property: [(property_identifier) (private_property_identifier)] @method.call)) property: [(property_identifier) (private_property_identifier)] @function.method.call))
; Builtins ; Builtins
;--------- ;---------
((identifier) @namespace.builtin ((identifier) @module.builtin
(#eq? @namespace.builtin "Intl")) (#eq? @module.builtin "Intl"))
((identifier) @function.builtin ((identifier) @function.builtin
(#any-of? @function.builtin (#any-of? @function.builtin
@ -159,7 +159,7 @@
; Variables ; Variables
;---------- ;----------
(namespace_import (namespace_import
(identifier) @namespace) (identifier) @module)
; Decorators ; Decorators
;---------- ;----------
@ -192,15 +192,15 @@
((comment) @comment.documentation ((comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
(hash_bang_line) @preproc (hash_bang_line) @keyword.directive
((string_fragment) @preproc ((string_fragment) @keyword.directive
(#eq? @preproc "use strict")) (#eq? @keyword.directive "use strict"))
(string) @string (string) @string
(template_string) @string (template_string) @string
(escape_sequence) @string.escape (escape_sequence) @string.escape
(regex_pattern) @string.regex (regex_pattern) @string.regexp
(regex_flags) @character.special (regex_flags) @character.special
(regex "/" @punctuation.bracket) ; Regex delimiters (regex "/" @punctuation.bracket) ; Regex delimiters
@ -266,7 +266,7 @@
] @operator ] @operator
(binary_expression "/" @operator) (binary_expression "/" @operator)
(ternary_expression ["?" ":"] @conditional.ternary) (ternary_expression ["?" ":"] @keyword.conditional.ternary)
(unary_expression ["!" "~" "-" "+"] @operator) (unary_expression ["!" "~" "-" "+"] @operator)
(unary_expression ["delete" "void"] @keyword.operator) (unary_expression ["delete" "void"] @keyword.operator)
@ -289,17 +289,17 @@
"else" "else"
"switch" "switch"
"case" "case"
] @conditional ] @keyword.conditional
[ [
"import" "import"
"from" "from"
] @include ] @keyword.import
(export_specifier "as" @include) (export_specifier "as" @keyword.import)
(import_specifier "as" @include) (import_specifier "as" @keyword.import)
(namespace_export "as" @include) (namespace_export "as" @keyword.import)
(namespace_import "as" @include) (namespace_import "as" @keyword.import)
[ [
"for" "for"
@ -307,7 +307,7 @@
"do" "do"
"while" "while"
"continue" "continue"
] @repeat ] @keyword.repeat
[ [
"break" "break"
@ -352,9 +352,9 @@
"try" "try"
"catch" "catch"
"finally" "finally"
] @exception ] @keyword.exception
(export_statement (export_statement
"default" @keyword) "default" @keyword)
(switch_default (switch_default
"default" @conditional) "default" @keyword.conditional)

View file

@ -40,7 +40,7 @@
(quoted_atom) (quoted_atom)
(keyword) (keyword)
(quoted_keyword) (quoted_keyword)
] @symbol ] @string.special.symbol
; Interpolation ; Interpolation
(interpolation ["#{" "}"] @string.special) (interpolation ["#{" "}"] @string.special)
@ -52,7 +52,7 @@
(integer) @number (integer) @number
; Floats ; Floats
(float) @float (float) @number.float
; Characters ; Characters
[ [

View file

@ -16,7 +16,7 @@
"else" "else"
(case) (case)
(of) (of)
] @conditional ] @keyword.conditional
[ [
"let" "let"
@ -32,7 +32,7 @@
[ [
(import) (import)
(exposing) (exposing)
] @include ] @keyword.import
; Punctuation ; Punctuation
@ -79,14 +79,14 @@
(lower_case_identifier) @variable) (lower_case_identifier) @variable)
(value_qid (value_qid
((dot) (lower_case_identifier) @field)) ((dot) (lower_case_identifier) @variable.member))
(field_access_expr (field_access_expr
((dot) (lower_case_identifier) @field)) ((dot) (lower_case_identifier) @variable.member))
(function_declaration_left (function_declaration_left
(anything_pattern (underscore) @parameter)) (anything_pattern (underscore) @variable.parameter))
(function_declaration_left (function_declaration_left
(lower_pattern (lower_case_identifier) @parameter)) (lower_pattern (lower_case_identifier) @variable.parameter))
; Functions ; Functions
@ -136,13 +136,13 @@
;-------- ;--------
(module_declaration (module_declaration
(upper_case_qid (upper_case_identifier) @namespace)) (upper_case_qid (upper_case_identifier) @module))
(import_clause (import_clause
(upper_case_qid (upper_case_identifier) @namespace)) (upper_case_qid (upper_case_identifier) @module))
(as_clause (as_clause
(upper_case_identifier) @namespace) (upper_case_identifier) @module)
(value_expr (value_expr
(value_qid (upper_case_identifier) @namespace)) (value_qid (upper_case_identifier) @module))
; Types ; Types

View file

@ -11,11 +11,11 @@
; Method ; Method
(method) @method (method) @function.method
; Parameter ; Parameter
(parameter) @parameter (parameter) @variable.parameter
; Variables ; Variables

View file

@ -1,21 +1,21 @@
(comment) @comment @spell (comment) @comment @spell
["if" "elif"] @conditional ["if" "elif"] @keyword.conditional
(if (else "else" @conditional)) (if (else "else" @keyword.conditional))
["while" "for"] @repeat ["while" "for"] @keyword.repeat
(while (else "else" @repeat)) (while (else "else" @keyword.repeat))
(for (else "else" @repeat)) (for (else "else" @keyword.repeat))
["try" "catch" "finally"] @exception ["try" "catch" "finally"] @keyword.exception
(try (else "else" @exception)) (try (else "else" @keyword.exception))
"use" @include "use" @keyword.import
(import (bareword) @string.special) (import (bareword) @string.special.path)
(wildcard ["*" "**" "?"] @character.special) (wildcard ["*" "**" "?"] @character.special)
(command argument: (bareword) @parameter) (command argument: (bareword) @variable.parameter)
(command head: (identifier) @function.call) (command head: (identifier) @function.call)
((command head: (identifier) @keyword.return) ((command head: (identifier) @keyword.return)
(#eq? @keyword.return "return")) (#eq? @keyword.return "return"))
@ -34,7 +34,7 @@
"fn" @keyword.function "fn" @keyword.function
(identifier) @function) (identifier) @function)
(parameter_list) @parameter (parameter_list) @variable.parameter
(parameter_list "|" @punctuation.bracket) (parameter_list "|" @punctuation.bracket)
["var" "set" "tmp" "del"] @keyword ["var" "set" "tmp" "del"] @keyword

View file

@ -3,7 +3,7 @@
(char) @character (char) @character
(integer) @number (integer) @number
(float) @float (float) @number.float
(comment) @comment @spell (comment) @comment @spell
@ -70,12 +70,12 @@
"end" "end"
"maybe" "maybe"
"else" "else"
] @conditional ] @keyword.conditional
[ [
"catch" "catch"
"try" "try"
] @exception ] @keyword.exception
((atom) @boolean (#any-of? @boolean "true" "false")) ((atom) @boolean (#any-of? @boolean "true" "false"))
@ -86,26 +86,26 @@
(pp_define (pp_define
lhs: _ @constant.macro (#set! "priority" 101) lhs: _ @constant.macro (#set! "priority" 101)
) )
(_preprocessor_directive) @preproc (#set! "priority" 99) (_preprocessor_directive) @keyword.directive (#set! "priority" 99)
;; Attributes ;; Attributes
(pp_include) @include (pp_include) @keyword.import
(pp_include_lib) @include (pp_include_lib) @keyword.import
(export_attribute) @include (export_attribute) @keyword.import
(export_type_attribute) @type.definition (export_type_attribute) @type.definition
(export_type_attribute types: (fa fun: _ @type (#set! "priority" 101))) (export_type_attribute types: (fa fun: _ @type (#set! "priority" 101)))
(behaviour_attribute) @include (behaviour_attribute) @keyword.import
(module_attribute (atom) @namespace) @include (module_attribute (atom) @module) @keyword.import
(wild_attribute name: (attr_name name: _ @attribute)) @attribute (wild_attribute name: (attr_name name: _ @attribute)) @attribute
;; Records ;; Records
(record_expr) @type (record_expr) @type
(record_field_expr _ @field) @type (record_field_expr _ @variable.member) @type
(record_field_name _ @field) @type (record_field_name _ @variable.member) @type
(record_name "#" @type name: _ @type) @type (record_name "#" @type name: _ @type) @type
(record_decl name: _ @type) @type.definition (record_decl name: _ @type) @type.definition
(record_field name: _ @field) (record_field name: _ @variable.member)
(record_field name: _ @field ty: _ @type) (record_field name: _ @variable.member ty: _ @type)
;; Type alias ;; Type alias
(type_alias name: _ @type) @type.definition (type_alias name: _ @type) @type.definition
@ -115,7 +115,7 @@
;;; expr_function_call ;;; expr_function_call
(call expr: [(atom) (remote) (var)] @function) (call expr: [(atom) (remote) (var)] @function)
(call (atom) @exception (#any-of? @exception "error" "throw" "exit")) (call (atom) @keyword.exception (#any-of? @keyword.exception "error" "throw" "exit"))
;;; Parenthesized expression: (SomeFunc)(), only highlight the parens ;;; Parenthesized expression: (SomeFunc)(), only highlight the parens
(call (call

View file

@ -75,7 +75,7 @@
name: (identifier) @variable) name: (identifier) @variable)
(method (method
name: (identifier) @method) name: (identifier) @function.method)
(number_literal) @number (number_literal) @number
(string_literal) @string (string_literal) @string

View file

@ -30,11 +30,11 @@
(multi_symbol (multi_symbol
"." @punctuation.delimiter "." @punctuation.delimiter
(symbol) @field) (symbol) @variable.member)
(multi_symbol_method (multi_symbol_method
":" @punctuation.delimiter ":" @punctuation.delimiter
(symbol) @method.call .) (symbol) @function.method.call .)
(list . (symbol) @function.call) (list . (symbol) @function.call)
(list . (multi_symbol (symbol) @function.call .)) (list . (multi_symbol (symbol) @function.call .))
@ -42,7 +42,7 @@
((symbol) @variable.builtin ((symbol) @variable.builtin
(#lua-match? @variable.builtin "^[$]")) (#lua-match? @variable.builtin "^[$]"))
(binding) @symbol (binding) @string.special.symbol
[ [
"fn" "fn"
@ -64,16 +64,16 @@
[ [
"for" "for"
"each" "each"
] @repeat ] @keyword.repeat
((symbol) @repeat ((symbol) @keyword.repeat
(#any-of? @repeat (#any-of? @keyword.repeat
"while")) "while"))
[ [
"match" "match"
] @conditional ] @keyword.conditional
((symbol) @conditional ((symbol) @keyword.conditional
(#any-of? @conditional (#any-of? @keyword.conditional
"if" "when")) "if" "when"))
[ [
@ -89,8 +89,8 @@
(#any-of? @keyword (#any-of? @keyword
"comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values")) "comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values"))
((symbol) @include ((symbol) @keyword.import
(#any-of? @include (#any-of? @keyword.import
"require" "require-macros" "import-macros" "include")) "require" "require-macros" "import-macros" "include"))
[ [

View file

@ -1,8 +1,8 @@
; Namespaces ; Namespaces
(circuit (identifier) @namespace) (circuit (identifier) @module)
(module (identifier) @namespace) (module (identifier) @module)
; Types ; Types
@ -52,14 +52,14 @@
[ [
"input" "input"
"output" "output"
] @storageclass ] @keyword.storage
; Conditionals ; Conditionals
[ [
"when" "when"
"else" "else"
] @conditional ] @keyword.conditional
; Annotations ; Annotations
@ -99,31 +99,31 @@
"reader" "reader"
"writer" "writer"
"readwriter" "readwriter"
] @field.builtin ] @variable.member.builtin
((field_id) @field ((field_id) @variable.member
(#set! "priority" 105)) (#set! "priority" 105))
(port (identifier) @field) (port (identifier) @variable.member)
(wire (identifier) @field) (wire (identifier) @variable.member)
(cmem (identifier) @field) (cmem (identifier) @variable.member)
(smem (identifier) @field) (smem (identifier) @variable.member)
(memory (identifier) @field) (memory (identifier) @variable.member)
(register (identifier) @field) (register (identifier) @variable.member)
; Parameters ; Parameters
(primitive_operation (identifier) @parameter) (primitive_operation (identifier) @variable.parameter)
(mux (identifier) @parameter) (mux (identifier) @variable.parameter)
(printf (identifier) @parameter) (printf (identifier) @variable.parameter)
(reset (identifier) @parameter) (reset (identifier) @variable.parameter)
(stop (identifier) @parameter) (stop (identifier) @variable.parameter)
; Variables ; Variables
@ -151,7 +151,7 @@
(number_str) @string.special (number_str) @string.special
(double) @float (double) @number.float
(string) @string (string) @string

View file

@ -35,29 +35,29 @@
[ [
"if" "if"
"end" "end"
] @conditional) ] @keyword.conditional)
(switch_statement (switch_statement
[ [
"switch" "switch"
"end" "end"
] @conditional) ] @keyword.conditional)
(case_clause (case_clause
[ [
"case" "case"
] @conditional) ] @keyword.conditional)
(else_clause (else_clause
[ [
"else" "else"
] @conditional) ] @keyword.conditional)
(else_if_clause (else_if_clause
[ [
"else" "else"
"if" "if"
] @conditional) ] @keyword.conditional)
;; Loops/Blocks ;; Loops/Blocks
@ -65,19 +65,19 @@
[ [
"while" "while"
"end" "end"
] @repeat) ] @keyword.repeat)
(for_statement (for_statement
[ [
"for" "for"
"end" "end"
] @repeat) ] @keyword.repeat)
(begin_statement (begin_statement
[ [
"begin" "begin"
"end" "end"
] @repeat) ] @keyword.repeat)
;; Keywords ;; Keywords
@ -106,7 +106,7 @@
(command (command
argument: [ argument: [
(word) @parameter (#lua-match? @parameter "^[-]") (word) @variable.parameter (#lua-match? @variable.parameter "^[-]")
] ]
) )
@ -137,7 +137,7 @@
option: [ option: [
(word) (word)
(concatenation (word)) (concatenation (word))
] @parameter (#lua-match? @parameter "^[-]") ] @variable.parameter (#lua-match? @variable.parameter "^[-]")
) )
;; Strings ;; Strings
@ -159,5 +159,5 @@
((word) @boolean ((word) @boolean
(#any-of? @boolean "true" "false")) (#any-of? @boolean "true" "false"))
((program . (comment) @preproc) ((program . (comment) @keyword.directive)
(#lua-match? @preproc "^#!/")) (#lua-match? @keyword.directive "^#!/"))

View file

@ -11,32 +11,32 @@
;; Macros ;; Macros
(macro (macro
"$" @conditional "$" @keyword.conditional
(prev_scope)* @conditional (prev_scope)* @keyword.conditional
(identifier)* @namespace (identifier)* @module
) )
;; Directives ;; Directives
"#" @conditional "#" @keyword.conditional
(preproc_call (preproc_call
directive: (identifier)* @conditional directive: (identifier)* @keyword.conditional
argument: (identifier)* @namespace argument: (identifier)* @module
) )
((preproc_call ((preproc_call
argument: (identifier)* @namespace) @conditional argument: (identifier)* @module) @keyword.conditional
(#eq? @conditional "ifeq")) (#eq? @keyword.conditional "ifeq"))
((preproc_call) @conditional ((preproc_call) @keyword.conditional
(#any-of? @conditional "else" "endif")) (#any-of? @keyword.conditional "else" "endif"))
;; Literals ;; Literals
(number_literal) @float (number_literal) @number.float
(string_literal) @string (string_literal) @string
(escape_sequence) @string.escape (escape_sequence) @string.escape
(boolean) @boolean (boolean) @boolean
;; Treat [m^2 s^-2] the same as if it was put in numbers format ;; Treat [m^2 s^-2] the same as if it was put in numbers format
(dimensions dimension: (identifier) @float) (dimensions dimension: (identifier) @number.float)
;; Punctuation ;; Punctuation
[ [

View file

@ -1,26 +1,26 @@
; Preprocs ; Preprocs
(preproc_file_line) @preproc (preproc_file_line) @keyword.directive
; Namespaces ; Namespaces
(program_statement (program_statement
(name) @namespace) (name) @module)
(end_program_statement (end_program_statement
(name) @namespace) (name) @module)
(module_statement (module_statement
(name) @namespace) (name) @module)
(end_module_statement (end_module_statement
(name) @namespace) (name) @module)
(submodule_statement (submodule_statement
(name) @namespace) (name) @module)
(end_submodule_statement (end_submodule_statement
(name) @namespace) (name) @module)
; Includes ; Includes
@ -28,7 +28,7 @@
"import" "import"
"include" "include"
"use" "use"
] @include ] @keyword.import
(import_statement (import_statement
"," ","
@ -147,7 +147,7 @@
"in" "in"
"inout" "inout"
"out" "out"
] @storageclass ] @keyword.storage
; Labels ; Labels
@ -211,7 +211,7 @@
[ [
"error" "error"
] @exception ] @keyword.exception
; Conditionals ; Conditionals
@ -224,7 +224,7 @@
"if" "if"
"then" "then"
"where" "where"
] @conditional ] @keyword.conditional
; Repeats ; Repeats
@ -238,7 +238,7 @@
"continue" "continue"
"cycle" "cycle"
"exit" "exit"
] @repeat ] @keyword.repeat
; Variables ; Variables
@ -247,10 +247,10 @@
; Parameters ; Parameters
(keyword_argument (keyword_argument
name: (identifier) @parameter) name: (identifier) @variable.parameter)
(parameters (parameters
(identifier) @parameter) (identifier) @variable.parameter)
; Properties ; Properties

View file

@ -85,7 +85,7 @@
(flag) @constant (flag) @constant
; Special Params ; Special Params
(code_value) @parameter (code_value) @variable.parameter
; Extras ; Extras
(fsh_comment) @comment @spell (fsh_comment) @comment @spell

View file

@ -1,20 +1,20 @@
; Include ; Include
"#include" @include "#include" @keyword.import
(include_path) @string (include_path) @string
; Preproc ; Preproc
[ [
"#pragma" "#pragma"
] @preproc ] @keyword.directive
(pragma_directive (pragma_directive
[ [
"version" "version"
"not-version" "not-version"
"test-version-set" "test-version-set"
] @preproc) ] @keyword.directive)
; Keywords ; Keywords
@ -40,14 +40,14 @@
"elseif" "elseif"
"elseifnot" "elseifnot"
"until" "until"
] @conditional ] @keyword.conditional
; Exceptions ; Exceptions
[ [
"try" "try"
"catch" "catch"
] @exception ] @keyword.exception
; Repeats ; Repeats
@ -56,7 +56,7 @@
"forall" "forall"
"repeat" "repeat"
"while" "while"
] @repeat ] @keyword.repeat
; Qualifiers ; Qualifiers
[ [
@ -83,11 +83,11 @@
function: (identifier) @function) function: (identifier) @function)
(method_call (method_call
method_name: (identifier) @method.call) method_name: (identifier) @function.method.call)
; Parameters ; Parameters
(parameter) @parameter (parameter) @variable.parameter
; Types ; Types

View file

@ -12,7 +12,7 @@
(afx_attribute (afx_attribute
(afx_property_identifier) @tag.attribute) (afx_property_identifier) @tag.attribute)
(afx_text) @text (afx_text) @spell
; identifiers eel ; identifiers eel
@ -43,13 +43,13 @@
(include_statement (include_statement
[ [
"include" "include"
] @include ] @keyword.import
(source_file) @text.uri (source_file) @string.special.url
) )
(namespace_declaration (namespace_declaration
"namespace" @keyword "namespace" @keyword
(alias_namespace) @namespace) (alias_namespace) @module)
(type (type
name: (type_name) @type) name: (type_name) @type)
@ -78,7 +78,7 @@
[ [
(package_name) (package_name)
(alias_namespace) (alias_namespace)
] @namespace ] @module
(namespace_declaration "=" @operator) (namespace_declaration "=" @operator)
(assignment "=" @operator) (assignment "=" @operator)
@ -117,4 +117,4 @@
] @punctuation.delimiter ] @punctuation.delimiter
(eel_ternary_expression (eel_ternary_expression
["?" ":"] @conditional.ternary) ["?" ":"] @keyword.conditional.ternary)

View file

@ -6,7 +6,7 @@
(comment) @comment @spell (comment) @comment @spell
(string_name) @string (string_name) @string
(string) @string (string) @string
(float) @float (float) @number.float
(integer) @number (integer) @number
(null) @constant (null) @constant
(setter) @function (setter) @function
@ -15,14 +15,14 @@
(get_body "get" @keyword.function) (get_body "get" @keyword.function)
(static_keyword) @type.qualifier (static_keyword) @type.qualifier
(tool_statement) @keyword (tool_statement) @keyword
(breakpoint_statement) @debug (breakpoint_statement) @keyword.debug
(inferred_type) @operator (inferred_type) @operator
[(true) (false)] @boolean [(true) (false)] @boolean
[ [
(get_node) (get_node)
(node_path) (node_path)
] @text.uri ] @string.special.url
(class_name_statement (class_name_statement
(name) @type) @keyword (name) @type) @keyword
@ -44,14 +44,14 @@
(function_definition (function_definition
(name) @function (parameters (name) @function (parameters
(identifier) @parameter)*) (identifier) @variable.parameter)*)
(typed_parameter (identifier) @parameter) (typed_parameter (identifier) @variable.parameter)
(default_parameter (identifier) @parameter) (default_parameter (identifier) @variable.parameter)
(call (identifier) @function.call) (call (identifier) @function.call)
(call (identifier) @include (call (identifier) @keyword.import
(#any-of? @include "preload" "load")) (#any-of? @keyword.import "preload" "load"))
;; Properties and Methods ;; Properties and Methods
@ -63,9 +63,9 @@
; Same question but for methods? ; Same question but for methods?
(class_definition (class_definition
(body (function_definition (name) @method))) (body (function_definition (name) @function.method)))
(attribute_call (identifier) @method.call) (attribute_call (identifier) @function.method.call)
(attribute (_) (identifier) @property) (attribute (_) (identifier) @property)
;; Enums ;; Enums
@ -90,9 +90,9 @@
["," "." ":"] @punctuation.delimiter ["," "." ":"] @punctuation.delimiter
["if" "elif" "else" "match"] @conditional ["if" "elif" "else" "match"] @keyword.conditional
["for" "while" "break" "continue"] @repeat ["for" "while" "break" "continue"] @keyword.repeat
[ [
"~" "~"

View file

@ -2,13 +2,13 @@
(section_name) @type (section_name) @type
((section_name) @include ((section_name) @keyword.import
(#eq? @include "include")) (#eq? @keyword.import "include"))
((section_header ((section_header
(section_name) @include (section_name) @keyword.import
(subsection_name)) (subsection_name))
(#eq? @include "includeIf")) (#eq? @keyword.import "includeIf"))
(variable (name) @property) (variable (name) @property)
@ -28,11 +28,11 @@
(string) @string (string) @string
((string) @text.uri ((string) @string.special.path
(#lua-match? @text.uri "^[.]?[/]")) (#lua-match? @string.special.path "^[.]?[/]"))
((string) @text.uri ((string) @string.special.path
(#lua-match? @text.uri "^[~]")) (#lua-match? @string.special.path "^[~]"))
(section_header (section_header
[ [

View file

@ -1,6 +1,6 @@
((command) @keyword ((command) @keyword
(label)? @constant (label)? @constant
(message)? @text @spell) (message)? @none @spell)
(option) @operator (option) @operator

View file

@ -22,7 +22,7 @@
] @string.escape ] @string.escape
(attribute (attribute
(attr_name) @parameter) (attr_name) @variable.parameter)
(attribute (attribute
(builtin_attr) @variable.builtin) (builtin_attr) @variable.builtin)
@ -37,15 +37,16 @@
(string_value) @string (string_value) @string
(macro_tag) @preproc (macro_tag) @keyword.directive
(macro_def (macro_def
macro_name: (_) @property) macro_name: (_) @property)
[ ; we do not lint syntax errors
(pattern_negation) ; [
(redundant_escape) ; (pattern_negation)
(trailing_slash) ; (redundant_escape)
] @error ; (trailing_slash)
; ] @error
(comment) @comment @spell (comment) @comment @spell

View file

@ -1,17 +1,17 @@
(comment) @comment (comment) @comment
(generated_comment) @comment (generated_comment) @comment
(title) @text.title (title) @markup.heading
(text) @text ; (text) @none
(branch) @text.reference (branch) @markup.link
(change) @keyword (change) @keyword
(filepath) @text.uri (filepath) @string.special.url
(arrow) @punctuation.delimiter (arrow) @punctuation.delimiter
(subject) @text.title @spell (subject) @markup.heading @spell
(subject (overflow) @text @spell) (subject (overflow) @none @spell)
(subject (subject_prefix) @function @nospell) (subject (subject_prefix) @function @nospell)
(prefix (type) @keyword @nospell) (prefix (type) @keyword @nospell)
(prefix (scope) @parameter @nospell) (prefix (scope) @variable.parameter @nospell)
(prefix [ (prefix [
"(" "("
")" ")"
@ -21,12 +21,12 @@
"!" "!"
] @punctuation.special) ] @punctuation.special)
(message) @text @spell (message) @spell
(trailer (token) @label) (trailer (token) @label)
(trailer (value) @text) ; (trailer (value) @none)
(breaking_change (token) @text.warning) (breaking_change (token) @comment.warning)
(breaking_change (value) @text @spell) (breaking_change (value) @none @spell)
(scissor) @comment (scissor) @comment

View file

@ -16,18 +16,18 @@
; Imports ; Imports
[ [
"import" "import"
] @include ] @keyword.import
; Conditionals ; Conditionals
[ [
"case" "case"
"if" "if"
] @conditional ] @keyword.conditional
; Exceptions ; Exceptions
[ [
"assert" "assert"
] @exception ] @keyword.exception
; Punctuation ; Punctuation
[ [
@ -99,9 +99,9 @@
] @comment ] @comment
; Modules & Imports ; Modules & Imports
(module) @namespace (module) @module
(import alias: ((identifier) @namespace)?) (import alias: ((identifier) @module)?)
(remote_type_identifier module: (identifier) @namespace) (remote_type_identifier module: (identifier) @module)
(unqualified_import name: (identifier) @function) (unqualified_import name: (identifier) @function)
; Strings ; Strings
@ -113,11 +113,11 @@
; Numbers ; Numbers
(integer) @number (integer) @number
(float) @float (float) @number.float
; Function Parameter Labels ; Function Parameter Labels
(function_call arguments: (arguments (argument label: (label) @label))) (function_call arguments: (arguments (argument label: (label) @label)))
(function_parameter label: (label)? @label name: (identifier) @parameter) (function_parameter label: (label)? @label name: (identifier) @variable.parameter)
; Records ; Records
(record arguments: (arguments (argument label: (label) @property)?)) (record arguments: (arguments (argument label: (label) @property)?))
@ -154,7 +154,7 @@
; External Functions ; External Functions
(external_function name: (identifier) @function) (external_function name: (identifier) @function)
(external_function_body (string) @namespace . (string) @function) (external_function_body (string) @module . (string) @function)
; Constructors ; Constructors
(constructor_name) @type @constructor (constructor_name) @type @constructor

View file

@ -23,10 +23,10 @@
(block_statement_end) @tag.delimiter (block_statement_end) @tag.delimiter
; Highlight `if`/`each`/`let` ; Highlight `if`/`each`/`let`
(block_statement_start path: (identifier) @conditional) (block_statement_start path: (identifier) @keyword.conditional)
(block_statement_end path: (identifier) @conditional) (block_statement_end path: (identifier) @keyword.conditional)
((mustache_statement (identifier) @conditional) ((mustache_statement (identifier) @keyword.conditional)
(#lua-match? @conditional "else")) (#lua-match? @keyword.conditional "else"))
; == Mustache Statements === ; == Mustache Statements ===
@ -66,8 +66,8 @@
(identifier) @function (identifier) @function
]) ])
(#not-any-of? @function "if" "yield")) (#not-any-of? @function "if" "yield"))
((helper_invocation helper: (identifier) @conditional) ((helper_invocation helper: (identifier) @keyword.conditional)
(#eq? @conditional "if")) (#eq? @keyword.conditional "if"))
((helper_invocation helper: (identifier) @keyword) ((helper_invocation helper: (identifier) @keyword)
(#eq? @keyword "yield")) (#eq? @keyword "yield"))

View file

@ -29,7 +29,7 @@
"subroutine" @keyword.function "subroutine" @keyword.function
(extension_storage_class) @storageclass (extension_storage_class) @keyword.storage
((identifier) @variable.builtin ((identifier) @variable.builtin
(#lua-match? @variable.builtin "^gl_")) (#lua-match? @variable.builtin "^gl_"))

View file

@ -1,17 +1,17 @@
; Includes ; Includes
"import" @include "import" @keyword.import
; Conditionals ; Conditionals
[ [
"if" "if"
"else" "else"
] @conditional ] @keyword.conditional
; Repeats ; Repeats
"foreach" @repeat "foreach" @keyword.repeat
; Operators ; Operators
@ -42,7 +42,7 @@
; Fields ; Fields
(scope_access field: (identifier) @field) (scope_access field: (identifier) @variable.member)
; Literals ; Literals

View file

@ -8,10 +8,10 @@
(type_spec name: (type_identifier) @type.definition) (type_spec name: (type_identifier) @type.definition)
(field_identifier) @property (field_identifier) @property
(identifier) @variable (identifier) @variable
(package_identifier) @namespace (package_identifier) @module
(parameter_declaration (identifier) @parameter) (parameter_declaration (identifier) @variable.parameter)
(variadic_parameter_declaration (identifier) @parameter) (variadic_parameter_declaration (identifier) @variable.parameter)
(label_name) @label (label_name) @label
@ -25,7 +25,7 @@
(call_expression (call_expression
function: (selector_expression function: (selector_expression
field: (field_identifier) @method.call)) field: (field_identifier) @function.method.call))
; Function definitions ; Function definitions
@ -33,10 +33,10 @@
name: (identifier) @function) name: (identifier) @function)
(method_declaration (method_declaration
name: (field_identifier) @method) name: (field_identifier) @function.method)
(method_spec (method_spec
name: (field_identifier) @method) name: (field_identifier) @function.method)
; Constructors ; Constructors
@ -112,19 +112,19 @@
"return" @keyword.return "return" @keyword.return
"go" @keyword.coroutine "go" @keyword.coroutine
"for" @repeat "for" @keyword.repeat
[ [
"import" "import"
"package" "package"
] @include ] @keyword.import
[ [
"else" "else"
"case" "case"
"switch" "switch"
"if" "if"
] @conditional ] @keyword.conditional
;; Builtin types ;; Builtin types
@ -204,7 +204,7 @@
(escape_sequence) @string.escape (escape_sequence) @string.escape
(int_literal) @number (int_literal) @number
(float_literal) @float (float_literal) @number.float
(imaginary_literal) @number (imaginary_literal) @number
[ [
@ -218,8 +218,8 @@
] @constant.builtin ] @constant.builtin
(keyed_element (keyed_element
. (literal_element (identifier) @field)) . (literal_element (identifier) @variable.member))
(field_declaration name: (field_identifier) @field) (field_declaration name: (field_identifier) @variable.member)
; Comments ; Comments

View file

@ -5,7 +5,7 @@
( (
(method_declaration (method_declaration
name: (field_identifier) @local.definition.method); @method name: (field_identifier) @local.definition.method); @function.method
) )
(short_var_declaration (short_var_declaration

View file

@ -6,7 +6,7 @@
(string) @string (string) @string
(integer) @number (integer) @number
(float) @float (float) @number.float
(true) @constant.builtin (true) @constant.builtin
(false) @constant.builtin (false) @constant.builtin

View file

@ -11,7 +11,7 @@
"=>" @operator "=>" @operator
(comment) @comment @spell (comment) @comment @spell
(module_path) @text.uri (module_path) @string.special.url
[ [
(version) (version)

View file

@ -8,11 +8,11 @@
] @keyword ] @keyword
(module_path) @string @text.uri (module_path) @string.special.url
(module_version) @string.special (module_version) @string.special
(hash_version) @attribute (hash_version) @attribute
(hash) @symbol (hash) @string.special.symbol
[ [
(number) (number)

View file

@ -1,8 +1,8 @@
(option . _ @keyword) (option . _ @keyword)
(option (option
("no-" @parameter)? ("no-" @variable.parameter)?
(name) @parameter) (name) @variable.parameter)
(string (content) @string) (string (content) @string)
@ -11,7 +11,7 @@
"clear" "clear"
] @string.special ] @string.special
(url) @text.uri (url) @string.special.url
(key) @constant (key) @constant
@ -25,9 +25,9 @@
"sensitive:" @type.qualifier "sensitive:" @type.qualifier
(filter_name) @parameter (filter_name) @variable.parameter
(filter_scope) @namespace (filter_scope) @module
(filter_property) @property (filter_property) @property

View file

@ -80,17 +80,17 @@
(input_fields_definition (input_fields_definition
(input_value_definition (input_value_definition
(name) @parameter)) (name) @variable.parameter))
(argument (argument
(name) @parameter) (name) @variable.parameter)
(arguments_definition (arguments_definition
(input_value_definition (input_value_definition
(name) @parameter)) (name) @variable.parameter))
(variable_definition (variable_definition
(variable) @parameter) (variable) @variable.parameter)
(argument (argument
(value (value
@ -103,7 +103,7 @@
(int_value) @number (int_value) @number
(float_value) @float (float_value) @number.float
(boolean_value) @boolean (boolean_value) @boolean

View file

@ -7,7 +7,7 @@
(block (block
(unit (unit
(identifier) @namespace)) (identifier) @module))
(func (func
(identifier) @function) (identifier) @function)
@ -64,8 +64,8 @@
"private" "private"
"public")) "public"))
((identifier) @exception ((identifier) @keyword.exception
(#any-of? @exception (#any-of? @keyword.exception
"throw" "throw"
"finally" "finally"
"try" "try"

View file

@ -16,7 +16,7 @@
] @punctuation.bracket ] @punctuation.bracket
(property (property
key: (identifier) @field) key: (identifier) @variable.member)
(value) @string (value) @string
(string_literal) @string (string_literal) @string
(cap (cap

View file

@ -43,7 +43,7 @@
"include_once" "include_once"
"require" "require"
"require_once" "require_once"
] @include ] @keyword.import
[ [
"new" "new"
@ -184,10 +184,10 @@
] @operator ] @operator
(integer) @number (integer) @number
(float) @float (float) @number.float
(parameter (parameter
(variable) @parameter) (variable) @variable.parameter)
(call_expression (call_expression
function: (qualified_identifier (identifier) @function.call .)) function: (qualified_identifier (identifier) @function.call .))
@ -197,23 +197,23 @@
(call_expression (call_expression
function: (selection_expression function: (selection_expression
(qualified_identifier (identifier) @method.call .))) (qualified_identifier (identifier) @function.method.call .)))
(qualified_identifier (qualified_identifier
(_) @namespace . (_) @module .
(_)) (_))
(use_statement (use_statement
(qualified_identifier (qualified_identifier
(_) @namespace .) (_) @module .)
(use_clause)) (use_clause))
(use_statement (use_statement
(use_type "namespace") (use_type "namespace")
(use_clause (use_clause
(qualified_identifier (qualified_identifier
(identifier) @namespace .) (identifier) @module .)
alias: (identifier)? @namespace)) alias: (identifier)? @module))
(use_statement (use_statement
(use_type "const") (use_type "const")
@ -239,8 +239,8 @@
(use_clause (use_clause
(use_type "namespace") (use_type "namespace")
(qualified_identifier (qualified_identifier
(_) @namespace .) (_) @module .)
alias: (identifier)? @namespace) alias: (identifier)? @module)
(use_clause (use_clause
(use_type "function") (use_type "function")
@ -263,7 +263,7 @@
(function_declaration (function_declaration
name: (identifier) @function) name: (identifier) @function)
(method_declaration (method_declaration
name: (identifier) @method) name: (identifier) @function.method)
(type_arguments (type_arguments
[ "<" ">" ] @punctuation.bracket) [ "<" ">" ] @punctuation.bracket)
@ -279,7 +279,7 @@
"\\" @punctuation.delimiter) "\\" @punctuation.delimiter)
(ternary_expression (ternary_expression
["?" ":"] @conditional.ternary) ["?" ":"] @keyword.conditional.ternary)
[ [
"if" "if"
@ -287,13 +287,13 @@
"elseif" "elseif"
"switch" "switch"
"case" "case"
] @conditional ] @keyword.conditional
[ [
"try" "try"
"catch" "catch"
"finally" "finally"
] @exception ] @keyword.exception
[ [
"for" "for"
@ -302,7 +302,7 @@
"do" "do"
"continue" "continue"
"break" "break"
] @repeat ] @keyword.repeat
[ [
(string) (string)

View file

@ -23,18 +23,18 @@
[ [
"use" "use"
] @include ] @keyword.import
(use_statement (use_statement
(scoped_type_identifier (scoped_type_identifier
(identifier) @namespace)) (identifier) @module))
(use_statement (use_statement
(identifier) @namespace "{") (identifier) @module "{")
(use_statement (use_statement
. (identifier) @namespace .) . (identifier) @module .)
((scoped_type_identifier ((scoped_type_identifier
path: (_) @namespace) path: (_) @module)
(#set! "priority" 105)) (#set! "priority" 105))
; Keywords ; Keywords
@ -103,7 +103,7 @@
(call_expression (call_expression
. (scoped_type_identifier . (scoped_type_identifier
. (identifier) . "::" . (identifier) @method.call)) . (identifier) . "::" . (identifier) @function.method.call))
((call_expression ((call_expression
. (identifier) @function.builtin) . (identifier) @function.builtin)
@ -123,25 +123,25 @@
; Parameters ; Parameters
(parameter (parameter
(_) @parameter . ":") (_) @variable.parameter . ":")
; Fields ; Fields
((member_expression ((member_expression
"." (_) @field) "." (_) @variable.member)
(#set! "priority" 105)) (#set! "priority" 105))
(field (field
. (identifier) @field) . (identifier) @variable.member)
(field_assignment (field_assignment
. (identifier) @field) . (identifier) @variable.member)
; Repeats ; Repeats
[ [
"for" "for"
] @repeat ] @keyword.repeat
; Conditionals ; Conditionals
@ -152,7 +152,7 @@
"switch" "switch"
"match" "match"
"case" "case"
] @conditional ] @keyword.conditional
; Operators ; Operators
@ -237,7 +237,7 @@
(number) @number (number) @number
(float) @float (float) @number.float
(boolean) @boolean (boolean) @boolean

View file

@ -8,27 +8,27 @@
(pat_wildcard) @variable (pat_wildcard) @variable
(function (function
patterns: (patterns (_) @parameter)) patterns: (patterns (_) @variable.parameter))
(exp_lambda (_)+ @parameter "->") (exp_lambda (_)+ @variable.parameter "->")
(function (function
infix: (infix infix: (infix
lhs: (_) @parameter)) lhs: (_) @variable.parameter))
(function (function
infix: (infix infix: (infix
rhs: (_) @parameter)) rhs: (_) @variable.parameter))
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
;; Literals and comments ;; Literals and comments
(integer) @number (integer) @number
(exp_negation) @number (exp_negation) @number
(exp_literal (float)) @float (exp_literal (float)) @number.float
(char) @character (char) @character
(string) @string (string) @string
(con_unit) @symbol ; unit, as in () (con_unit) @string.special.symbol ; unit, as in ()
(comment) @comment (comment) @comment
@ -82,9 +82,9 @@
[ [
"forall" "forall"
"∀" "∀"
] @repeat ] @keyword.repeat
(pragma) @preproc (pragma) @keyword.directive
[ [
"if" "if"
@ -92,13 +92,13 @@
"else" "else"
"case" "case"
"of" "of"
] @conditional ] @keyword.conditional
[ [
"import" "import"
"qualified" "qualified"
"module" "module"
] @include ] @keyword.import
[ [
(operator) (operator)
@ -124,12 +124,12 @@
] @operator ] @operator
(module) @namespace (module) @module
((qualified_module (module) @constructor) ((qualified_module (module) @constructor)
. (module)) . (module))
(qualified_type (module) @namespace) (qualified_type (module) @module)
(qualified_variable (module) @namespace) (qualified_variable (module) @module)
(import (module) @namespace) (import (module) @module)
(import (module) @constructor . (module)) (import (module) @constructor . (module))
[ [
@ -250,7 +250,7 @@
[ [
((variable) @function.call) ((variable) @function.call)
(qualified_variable ( (qualified_variable (
(module) @namespace (module) @module
(variable) @function.call)) (variable) @function.call))
]) ])
. (operator)) . (operator))
@ -391,7 +391,7 @@
;; namespaced quasi-quoter ;; namespaced quasi-quoter
(quasiquote (quasiquote
(_ (_
(module) @namespace (module) @module
. (variable) @function.call . (variable) @function.call
)) ))
@ -400,8 +400,8 @@
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
;; Exceptions/error handling ;; Exceptions/error handling
((variable) @exception ((variable) @keyword.exception
(#any-of? @exception (#any-of? @keyword.exception
"error" "error"
"undefined" "undefined"
"try" "try"
@ -431,8 +431,8 @@
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
;; Debugging ;; Debugging
((variable) @debug ((variable) @keyword.debug
(#any-of? @debug (#any-of? @keyword.debug
"trace" "trace"
"traceId" "traceId"
"traceShow" "traceShow"
@ -453,11 +453,11 @@
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
;; Fields ;; Fields
(field (variable) @field) (field (variable) @variable.member)
(pat_field (variable) @field) (pat_field (variable) @variable.member)
(exp_projection field: (variable) @field) (exp_projection field: (variable) @variable.member)
(import_item (type) . (import_con_names (variable) @field)) (import_item (type) . (import_con_names (variable) @variable.member))
(exp_field field: [((variable) @field) (qualified_variable (variable) @field)]) (exp_field field: [((variable) @variable.member) (qualified_variable (variable) @variable.member)])
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------

View file

@ -2,13 +2,13 @@
;; Literals and comments ;; Literals and comments
(integer) @number (integer) @number
(float) @float (float) @number.float
(char) @character (char) @character
(string) @string (string) @string
(attribute_name) @attribute (attribute_name) @attribute
(attribute_exclamation_mark) @attribute (attribute_exclamation_mark) @attribute
(con_unit) @symbol ; unit, as in () (con_unit) @string.special.symbol ; unit, as in ()
(comment) @comment @spell (comment) @comment @spell

View file

@ -48,13 +48,13 @@
"for" "for"
"endfor" "endfor"
"in" "in"
] @repeat ] @keyword.repeat
[ [
"if" "if"
"else" "else"
"endif" "endif"
] @conditional ] @keyword.conditional
[ [
(quoted_template_start) ; " (quoted_template_start) ; "
@ -84,14 +84,14 @@
(body (block (identifier) @keyword)) (body (block (identifier) @keyword))
(body (block (body (block (identifier) @type)))) (body (block (body (block (identifier) @type))))
(function_call (identifier) @function) (function_call (identifier) @function)
(attribute (identifier) @field) (attribute (identifier) @variable.member)
; { key: val } ; { key: val }
; ;
; highlight identifier keys as though they were block attributes ; highlight identifier keys as though they were block attributes
(object_elem key: (expression (variable_expr (identifier) @field))) (object_elem key: (expression (variable_expr (identifier) @variable.member)))
; var.foo, data.bar ; var.foo, data.bar
; ;
; first element in get_attr is a variable.builtin or a reference to a variable.builtin ; first element in get_attr is a variable.builtin or a reference to a variable.builtin
(expression (variable_expr (identifier) @variable.builtin) (get_attr (identifier) @field)) (expression (variable_expr (identifier) @variable.builtin) (get_attr (identifier) @variable.member))

View file

@ -30,7 +30,7 @@
(comment) @comment @spell (comment) @comment @spell
; HEEx text content is treated as markup ; HEEx text content is treated as markup
(text) @text ; (text) @none
; HEEx tags and slots are highlighted as HTML ; HEEx tags and slots are highlighted as HTML
[ [

View file

@ -15,12 +15,12 @@
"required" "required"
] @keyword ] @keyword
(include "include" @include) (include "include" @keyword.import)
(substitution ["${" "${?" "}"] @punctuation.special) (substitution ["${" "${?" "}"] @punctuation.special)
(substitution (_) @field) (substitution (_) @variable.member)
(path (_) @field) (path (_) @variable.member)
(value [":" "=" "+=" ] @operator) (value [":" "=" "+=" ] @operator)
[ [

View file

@ -27,7 +27,7 @@
(date) @string.special (date) @string.special
(mold) @symbol (mold) @string.special.symbol
(specialIndex) @number.builtin (specialIndex) @number.builtin
(lark) @operator (lark) @operator
(fullContext) @symbol (fullContext) @string.special.symbol

View file

@ -1,54 +1,54 @@
(tag_name) @tag (tag_name) @tag
(erroneous_end_tag_name) @error ; (erroneous_end_tag_name) @error ; we do not lint syntax errors
(comment) @comment @spell (comment) @comment @spell
(attribute_name) @tag.attribute (attribute_name) @tag.attribute
((attribute ((attribute
(quoted_attribute_value) @string) (quoted_attribute_value) @string)
(#set! "priority" 99)) (#set! "priority" 99))
(text) @text @spell (text) @none @spell
((element (start_tag (tag_name) @_tag) (text) @text.title) ((element (start_tag (tag_name) @_tag) (text) @markup.heading)
(#eq? @_tag "title")) (#eq? @_tag "title"))
((element (start_tag (tag_name) @_tag) (text) @text.title.1) ((element (start_tag (tag_name) @_tag) (text) @markup.heading.1)
(#eq? @_tag "h1")) (#eq? @_tag "h1"))
((element (start_tag (tag_name) @_tag) (text) @text.title.2) ((element (start_tag (tag_name) @_tag) (text) @markup.heading.2)
(#eq? @_tag "h2")) (#eq? @_tag "h2"))
((element (start_tag (tag_name) @_tag) (text) @text.title.3) ((element (start_tag (tag_name) @_tag) (text) @markup.heading.3)
(#eq? @_tag "h3")) (#eq? @_tag "h3"))
((element (start_tag (tag_name) @_tag) (text) @text.title.4) ((element (start_tag (tag_name) @_tag) (text) @markup.heading.4)
(#eq? @_tag "h4")) (#eq? @_tag "h4"))
((element (start_tag (tag_name) @_tag) (text) @text.title.5) ((element (start_tag (tag_name) @_tag) (text) @markup.heading.5)
(#eq? @_tag "h5")) (#eq? @_tag "h5"))
((element (start_tag (tag_name) @_tag) (text) @text.title.6) ((element (start_tag (tag_name) @_tag) (text) @markup.heading.6)
(#eq? @_tag "h6")) (#eq? @_tag "h6"))
((element (start_tag (tag_name) @_tag) (text) @text.strong) ((element (start_tag (tag_name) @_tag) (text) @markup.strong)
(#any-of? @_tag "strong" "b")) (#any-of? @_tag "strong" "b"))
((element (start_tag (tag_name) @_tag) (text) @text.emphasis) ((element (start_tag (tag_name) @_tag) (text) @markup.italic)
(#any-of? @_tag "em" "i")) (#any-of? @_tag "em" "i"))
((element (start_tag (tag_name) @_tag) (text) @text.strike) ((element (start_tag (tag_name) @_tag) (text) @markup.strikethrough)
(#any-of? @_tag "s" "del")) (#any-of? @_tag "s" "del"))
((element (start_tag (tag_name) @_tag) (text) @text.underline) ((element (start_tag (tag_name) @_tag) (text) @markup.underline)
(#eq? @_tag "u")) (#eq? @_tag "u"))
((element (start_tag (tag_name) @_tag) (text) @text.literal) ((element (start_tag (tag_name) @_tag) (text) @markup.raw)
(#any-of? @_tag "code" "kbd")) (#any-of? @_tag "code" "kbd"))
((element (start_tag (tag_name) @_tag) (text) @text.uri) ((element (start_tag (tag_name) @_tag) (text) @string.special.url)
(#eq? @_tag "a")) (#eq? @_tag "a"))
((attribute ((attribute
(attribute_name) @_attr (attribute_name) @_attr
(quoted_attribute_value (attribute_value) @text.uri)) (quoted_attribute_value (attribute_value) @string.special.url))
(#any-of? @_attr "href" "src")) (#any-of? @_attr "href" "src"))
[ [

View file

@ -18,8 +18,8 @@
(variable_name) @variable (variable_name) @variable
(filter_name) @method (filter_name) @function.method
(filter_argument) @parameter (filter_argument) @variable.parameter
(keyword) @keyword (keyword) @keyword

View file

@ -4,7 +4,7 @@
; Methods ; Methods
(method) @method (method) @function.method
; Constants ; Constants
@ -16,11 +16,11 @@
; Fields ; Fields
(pair name: (identifier) @field) (pair name: (identifier) @variable.member)
; Parameters ; Parameters
(query_param (key) @parameter) (query_param (key) @variable.parameter)
; Operators ; Operators
@ -35,7 +35,7 @@
(string) @string (string) @string
(target_url) @string @text.uri (target_url) @string.special.url
(number) @number (number) @number

View file

@ -100,7 +100,7 @@
[ [
(float) (float)
(json_number) (json_number)
] @float ] @number.float
[ ":" "," ] @punctuation.delimiter [ ":" "," ] @punctuation.delimiter
@ -115,13 +115,16 @@
[ [
"base64," "base64,"
"file,"
"hex," "hex,"
(file_value)
(version) (version)
] @string.special ] @string.special
(regex) @string.regex [
"file,"
(file_value)
] @string.special.path
(regex) @string.regexp
(multiline_string_type) @type (multiline_string_type) @type

View file

@ -12,5 +12,4 @@
] @operator ] @operator
(setting (setting_name) @property) (setting (setting_name) @property)
(setting_value) @text ; grammar does not support subtypes ; (setting_value) @none ; grammar does not support subtypes
(ERROR (setting_name) @text)

View file

@ -24,11 +24,11 @@
"foreach_tiled" "foreach_tiled"
"foreach_active" "foreach_active"
"foreach_unique" "foreach_unique"
] @repeat ] @keyword.repeat
[ [
"cif" "cif"
] @conditional ] @keyword.conditional
[ [
"varying" "varying"

View file

@ -1,6 +1,6 @@
;; >> Literals ;; >> Literals
(kwd_lit) @symbol (kwd_lit) @string.special.symbol
(str_lit) @string (str_lit) @string
(long_str_lit) @string (long_str_lit) @string
(buf_lit) @string (buf_lit) @string
@ -31,10 +31,10 @@
;; Quoted symbols ;; Quoted symbols
(quote_lit (quote_lit
(sym_lit) @symbol) (sym_lit) @string.special.symbol)
(qq_lit (qq_lit
(sym_lit) @symbol) (sym_lit) @string.special.symbol)
;; Dynamic variables ;; Dynamic variables

View file

@ -7,30 +7,30 @@
; Methods ; Methods
(method_declaration (method_declaration
name: (identifier) @method) name: (identifier) @function.method)
(method_invocation (method_invocation
name: (identifier) @method.call) name: (identifier) @function.method.call)
(super) @function.builtin (super) @function.builtin
; Parameters ; Parameters
(formal_parameter (formal_parameter
name: (identifier) @parameter) name: (identifier) @variable.parameter)
(catch_formal_parameter (catch_formal_parameter
name: (identifier) @parameter) name: (identifier) @variable.parameter)
(spread_parameter (spread_parameter
(variable_declarator (variable_declarator
name: (identifier) @parameter)) ; int... foo name: (identifier) @variable.parameter)) ; int... foo
;; Lambda parameter ;; Lambda parameter
(inferred_parameters (identifier) @parameter) ; (x,y) -> ... (inferred_parameters (identifier) @variable.parameter) ; (x,y) -> ...
(lambda_expression (lambda_expression
parameters: (identifier) @parameter) ; x -> ... parameters: (identifier) @variable.parameter) ; x -> ...
; Operators ; Operators
@ -107,10 +107,10 @@
(field_declaration (field_declaration
declarator: (variable_declarator declarator: (variable_declarator
name: (identifier) @field)) name: (identifier) @variable.member))
(field_access (field_access
field: (identifier) @field) field: (identifier) @variable.member)
[ [
(boolean_type) (boolean_type)
@ -153,7 +153,7 @@
[ [
(decimal_floating_point_literal) (decimal_floating_point_literal)
(hex_floating_point_literal) (hex_floating_point_literal)
] @float ] @number.float
[ [
(true) (true)
@ -204,7 +204,7 @@
[ [
"transient" "transient"
"volatile" "volatile"
] @storageclass ] @keyword.storage
[ [
"return" "return"
@ -222,9 +222,9 @@
"else" "else"
"switch" "switch"
"case" "case"
] @conditional ] @keyword.conditional
(ternary_expression ["?" ":"] @conditional.ternary) (ternary_expression ["?" ":"] @keyword.conditional.ternary)
; Loops ; Loops
@ -234,7 +234,7 @@
"do" "do"
"continue" "continue"
"break" "break"
] @repeat ] @keyword.repeat
; Includes ; Includes
@ -247,7 +247,7 @@
"provides" "provides"
"requires" "requires"
"uses" "uses"
] @include ] @keyword.import
; Punctuation ; Punctuation
@ -277,7 +277,7 @@
"finally" "finally"
"try" "try"
"catch" "catch"
] @exception ] @keyword.exception
; Labels ; Labels

View file

@ -1,55 +1,55 @@
; inherits: ecma,jsx ; inherits: ecma,jsx
;;; Parameters ;;; Parameters
(formal_parameters (identifier) @parameter) (formal_parameters (identifier) @variable.parameter)
(formal_parameters (formal_parameters
(rest_pattern (rest_pattern
(identifier) @parameter)) (identifier) @variable.parameter))
;; ({ a }) => null ;; ({ a }) => null
(formal_parameters (formal_parameters
(object_pattern (object_pattern
(shorthand_property_identifier_pattern) @parameter)) (shorthand_property_identifier_pattern) @variable.parameter))
;; ({ a = b }) => null ;; ({ a = b }) => null
(formal_parameters (formal_parameters
(object_pattern (object_pattern
(object_assignment_pattern (object_assignment_pattern
(shorthand_property_identifier_pattern) @parameter))) (shorthand_property_identifier_pattern) @variable.parameter)))
;; ({ a: b }) => null ;; ({ a: b }) => null
(formal_parameters (formal_parameters
(object_pattern (object_pattern
(pair_pattern (pair_pattern
value: (identifier) @parameter))) value: (identifier) @variable.parameter)))
;; ([ a ]) => null ;; ([ a ]) => null
(formal_parameters (formal_parameters
(array_pattern (array_pattern
(identifier) @parameter)) (identifier) @variable.parameter))
;; ({ a } = { a }) => null ;; ({ a } = { a }) => null
(formal_parameters (formal_parameters
(assignment_pattern (assignment_pattern
(object_pattern (object_pattern
(shorthand_property_identifier_pattern) @parameter))) (shorthand_property_identifier_pattern) @variable.parameter)))
;; ({ a = b } = { a }) => null ;; ({ a = b } = { a }) => null
(formal_parameters (formal_parameters
(assignment_pattern (assignment_pattern
(object_pattern (object_pattern
(object_assignment_pattern (object_assignment_pattern
(shorthand_property_identifier_pattern) @parameter)))) (shorthand_property_identifier_pattern) @variable.parameter))))
;; a => null ;; a => null
(arrow_function (arrow_function
parameter: (identifier) @parameter) parameter: (identifier) @variable.parameter)
;; optional parameters ;; optional parameters
(formal_parameters (formal_parameters
(assignment_pattern (assignment_pattern
left: (identifier) @parameter)) left: (identifier) @variable.parameter))
;; punctuation ;; punctuation
(optional_chain) @punctuation.delimiter (optional_chain) @punctuation.delimiter

View file

@ -48,7 +48,7 @@
(identifier) @function) (identifier) @function)
(funcdefargs (funcdefargs
(identifier) @parameter) (identifier) @variable.parameter)
[ [
"reduce" "reduce"
@ -264,7 +264,7 @@
[ [
"import" "import"
"include" "include"
] @include ] @keyword.import
[ [
"if" "if"
@ -272,12 +272,12 @@
"elif" "elif"
"else" "else"
"end" "end"
] @conditional ] @keyword.conditional
[ [
"try" "try"
"catch" "catch"
] @exception ] @keyword.exception
[ [
"or" "or"

View file

@ -11,7 +11,7 @@
] @boolean ] @boolean
; Keywords ; Keywords
"for" @repeat "for" @keyword.repeat
"in" @keyword.operator "in" @keyword.operator
"function" @keyword.function "function" @keyword.function
@ -19,7 +19,7 @@
"if" "if"
"then" "then"
"else" "else"
] @conditional ] @keyword.conditional
[ [
(local) (local)
@ -30,7 +30,7 @@
[ [
"assert" "assert"
"error" "error"
] @exception ] @keyword.exception
[ [
(dollar) (dollar)
@ -84,12 +84,12 @@
[ [
(import) (import)
(importstr) (importstr)
] @include ] @keyword.import
; Fields ; Fields
(fieldname (id) @field) (fieldname (id) @variable.member)
(fieldname (string (string_content) @field)) (fieldname (string (string_content) @variable.member))
; Functions ; Functions
(field (field
@ -98,7 +98,7 @@
function: (fieldname function: (fieldname
(string (string_content) @function))) (string (string_content) @function)))
(param (param
identifier: (id) @parameter) identifier: (id) @variable.parameter)
(bind (id) @variable.local) (bind (id) @variable.local)
(bind function: (id) @function) (bind function: (id) @function)
@ -113,6 +113,6 @@
"(" "("
(args (args
(named_argument (named_argument
(id) @parameter (id) @variable.parameter
))? ))?
")") ")")

View file

@ -14,11 +14,11 @@
name: (identifier) @function.macro) name: (identifier) @function.macro)
(quote_expression (quote_expression
":" @symbol ":" @string.special.symbol
[(identifier) (operator)] @symbol) [(identifier) (operator)] @string.special.symbol)
(field_expression (field_expression
(identifier) @field .) (identifier) @variable.member .)
;;; Function names ;;; Function names
@ -68,18 +68,18 @@
;;; Parameters ;;; Parameters
(parameter_list (parameter_list
(identifier) @parameter) (identifier) @variable.parameter)
(optional_parameter . (optional_parameter .
(identifier) @parameter) (identifier) @variable.parameter)
(slurp_parameter (slurp_parameter
(identifier) @parameter) (identifier) @variable.parameter)
(typed_parameter (typed_parameter
parameter: (identifier)? @parameter parameter: (identifier)? @variable.parameter
type: (_) @type) type: (_) @type)
(function_expression (function_expression
. (identifier) @parameter) ; Single parameter arrow functions . (identifier) @variable.parameter) ; Single parameter arrow functions
;;; Types ;;; Types
@ -362,42 +362,42 @@
["let" "end"] @keyword) ["let" "end"] @keyword)
(if_statement (if_statement
["if" "end"] @conditional) ["if" "end"] @keyword.conditional)
(elseif_clause (elseif_clause
"elseif" @conditional) "elseif" @keyword.conditional)
(else_clause (else_clause
"else" @conditional) "else" @keyword.conditional)
(if_clause (if_clause
"if" @conditional) ; `if` clause in comprehensions "if" @keyword.conditional) ; `if` clause in comprehensions
(ternary_expression (ternary_expression
["?" ":"] @conditional.ternary) ["?" ":"] @keyword.conditional.ternary)
(try_statement (try_statement
["try" "end"] @exception) ["try" "end"] @keyword.exception)
(finally_clause (finally_clause
"finally" @exception) "finally" @keyword.exception)
(catch_clause (catch_clause
"catch" @exception) "catch" @keyword.exception)
(for_statement (for_statement
["for" "end"] @repeat) ["for" "end"] @keyword.repeat)
(while_statement (while_statement
["while" "end"] @repeat) ["while" "end"] @keyword.repeat)
(for_clause (for_clause
"for" @repeat) "for" @keyword.repeat)
[ [
(break_statement) (break_statement)
(continue_statement) (continue_statement)
] @repeat ] @keyword.repeat
(module_definition (module_definition
["module" "baremodule" "end"] @include) ["module" "baremodule" "end"] @keyword.import)
(import_statement (import_statement
["import" "using"] @include) ["import" "using"] @keyword.import)
(import_alias (import_alias
"as" @include) "as" @keyword.import)
(export_statement (export_statement
"export" @include) "export" @keyword.import)
(selected_import (selected_import
":" @punctuation.delimiter) ":" @punctuation.delimiter)
@ -458,10 +458,10 @@
(boolean_literal) @boolean (boolean_literal) @boolean
(integer_literal) @number (integer_literal) @number
(float_literal) @float (float_literal) @number.float
((identifier) @float ((identifier) @number.float
(#any-of? @float "NaN" "NaN16" "NaN32" (#any-of? @number.float "NaN" "NaN16" "NaN32"
"Inf" "Inf16" "Inf32")) "Inf" "Inf16" "Inf32"))
((identifier) @constant.builtin ((identifier) @constant.builtin

View file

@ -1,4 +1,4 @@
"source" @include "source" @keyword.import
[ [
"mainmenu" "mainmenu"
@ -24,7 +24,7 @@
"select" "select"
"imply" "imply"
"visible if" "visible if"
] @conditional ] @keyword.conditional
[ [
"def_bool" "def_bool"
@ -70,10 +70,10 @@
((symbol) @constant ((symbol) @constant
(#lua-match? @constant "[A-Z0-9]+")) (#lua-match? @constant "[A-Z0-9]+"))
(mainmenu name: (prompt) @text.title) (mainmenu name: (prompt) @markup.heading)
(comment_entry name: (prompt) @text.title) (comment_entry name: (prompt) @markup.heading)
(menu name: (prompt) @text.title) (menu name: (prompt) @markup.heading)
(source (prompt) @text.uri @string.special) (source (prompt) @string.special.url)
(comment) @comment @spell (comment) @comment @spell

View file

@ -29,8 +29,8 @@
(number) @number (number) @number
(number (decimal) @float) (number (decimal) @number.float)
(number (exponent) @float) (number (exponent) @number.float)
(boolean) @boolean (boolean) @boolean

View file

@ -97,10 +97,10 @@
)) ))
(package_header "package" @keyword (package_header "package" @keyword
. (identifier (simple_identifier) @namespace)) . (identifier (simple_identifier) @module))
(import_header (import_header
"import" @include) "import" @keyword.import)
; The last `simple_identifier` in a `import_header` will always either be a function ; The last `simple_identifier` in a `import_header` will always either be a function
; or a type. Classes can appear anywhere in the import path, unlike functions ; or a type. Classes can appear anywhere in the import path, unlike functions
@ -142,16 +142,16 @@
("init") @constructor) ("init") @constructor)
(parameter (parameter
(simple_identifier) @parameter) (simple_identifier) @variable.parameter)
(parameter_with_optional_type (parameter_with_optional_type
(simple_identifier) @parameter) (simple_identifier) @variable.parameter)
; lambda parameters ; lambda parameters
(lambda_literal (lambda_literal
(lambda_parameters (lambda_parameters
(variable_declaration (variable_declaration
(simple_identifier) @parameter))) (simple_identifier) @variable.parameter)))
;;; Function calls ;;; Function calls
@ -227,9 +227,9 @@
((multiline_comment) @comment.documentation ((multiline_comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
(shebang_line) @preproc (shebang_line) @keyword.directive
(real_literal) @float (real_literal) @number.float
[ [
(integer_literal) (integer_literal)
(long_literal) (long_literal)
@ -254,7 +254,7 @@
; - "[abc]?".toRegex() ; - "[abc]?".toRegex()
(call_expression (call_expression
(navigation_expression (navigation_expression
((string_literal) @string.regex) ((string_literal) @string.regexp)
(navigation_suffix (navigation_suffix
((simple_identifier) @_function ((simple_identifier) @_function
(#eq? @_function "toRegex"))))) (#eq? @_function "toRegex")))))
@ -266,7 +266,7 @@
(call_suffix (call_suffix
(value_arguments (value_arguments
(value_argument (value_argument
(string_literal) @string.regex)))) (string_literal) @string.regexp))))
; - Regex.fromLiteral("[abc]?") ; - Regex.fromLiteral("[abc]?")
(call_expression (call_expression
@ -279,7 +279,7 @@
(call_suffix (call_suffix
(value_arguments (value_arguments
(value_argument (value_argument
(string_literal) @string.regex)))) (string_literal) @string.regexp))))
;;; Keywords ;;; Keywords
@ -323,7 +323,7 @@
"if" "if"
"else" "else"
"when" "when"
] @conditional ] @keyword.conditional
[ [
"for" "for"
@ -333,14 +333,14 @@
"continue@" "continue@"
"break" "break"
"break@" "break@"
] @repeat ] @keyword.repeat
[ [
"try" "try"
"catch" "catch"
"throw" "throw"
"finally" "finally"
] @exception ] @keyword.exception
(annotation (annotation

View file

@ -12,8 +12,8 @@
] @function.call ] @function.call
(typed_parameter (typed_parameter
(identifier) @parameter) (identifier) @variable.parameter)
(function_arguments (identifier) @parameter) (function_arguments (identifier) @variable.parameter)
[ [
(binary_operator) (binary_operator)

View file

@ -10,7 +10,7 @@
[ [
"match" "match"
"else" "else"
] @conditional ] @keyword.conditional
[ [
"+" "+"
@ -32,7 +32,7 @@
["<" ">"] @punctuation.bracket) ["<" ">"] @punctuation.bracket)
(binding_symbol (binding_symbol
name: (identifier) @parameter) name: (identifier) @variable.parameter)
(bare_symbol (bare_symbol
(macro (macro
@ -54,7 +54,7 @@
[";" ":"] @punctuation.delimiter [";" ":"] @punctuation.delimiter
(lifetime (identifier) @storageclass) (lifetime (identifier) @keyword.storage)
(string_literal) @string (string_literal) @string
(regex_literal) @string (regex_literal) @string

View file

@ -6,7 +6,7 @@
command: _ @function) command: _ @function)
(key_value_pair (key_value_pair
key: (_) @parameter key: (_) @variable.parameter
value: (_)) value: (_))
[ [
@ -15,13 +15,13 @@
(comment_environment) (comment_environment)
] @comment @spell ] @comment @spell
((line_comment) @preproc ((line_comment) @keyword.directive
(#lua-match? @preproc "^%% !TeX")) (#lua-match? @keyword.directive "^%% !TeX"))
[ [
(brack_group) (brack_group)
(brack_group_argc) (brack_group_argc)
] @parameter ] @variable.parameter
[(operator) "="] @operator [(operator) "="] @operator
@ -34,12 +34,12 @@
;; General environments ;; General environments
(begin (begin
command: _ @text.environment command: _ @markup.environment
name: (curly_group_text (text) @text.environment.name)) name: (curly_group_text (text) @markup.environment.name))
(end (end
command: _ @text.environment command: _ @markup.environment
name: (curly_group_text (text) @text.environment.name)) name: (curly_group_text (text) @markup.environment.name))
;; Definitions and references ;; Definitions and references
(new_command_definition (new_command_definition
@ -54,11 +54,11 @@
(environment_definition (environment_definition
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
(theorem_definition (theorem_definition
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.environment.name)) name: (curly_group_text (_) @markup.environment.name))
(paired_delimiter_definition (paired_delimiter_definition
command: _ @function.macro command: _ @function.macro
@ -66,178 +66,178 @@
(label_definition (label_definition
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
(label_reference_range (label_reference_range
command: _ @function.macro command: _ @function.macro
from: (curly_group_text (_) @text.reference) from: (curly_group_text (_) @markup.link)
to: (curly_group_text (_) @text.reference)) to: (curly_group_text (_) @markup.link))
(label_reference (label_reference
command: _ @function.macro command: _ @function.macro
names: (curly_group_text_list (_) @text.reference)) names: (curly_group_text_list (_) @markup.link))
(label_number (label_number
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference) name: (curly_group_text (_) @markup.link)
number: (_) @text.reference) number: (_) @markup.link)
(citation (citation
command: _ @function.macro command: _ @function.macro
keys: (curly_group_text_list) @text.reference) keys: (curly_group_text_list) @markup.link)
(glossary_entry_definition (glossary_entry_definition
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
(glossary_entry_reference (glossary_entry_reference
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
(acronym_definition (acronym_definition
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
(acronym_reference (acronym_reference
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
(color_definition (color_definition
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
(color_reference (color_reference
command: _ @function.macro command: _ @function.macro
name: (curly_group_text (_) @text.reference)) name: (curly_group_text (_) @markup.link))
;; Math ;; Math
[ [
(displayed_equation) (displayed_equation)
(inline_formula) (inline_formula)
] @text.math ] @markup.math
(math_environment (math_environment
(begin (begin
command: _ @text.math command: _ @markup.math
name: (curly_group_text (text) @text.math))) name: (curly_group_text (text) @markup.math)))
(math_environment (math_environment
(text) @text.math) (text) @markup.math)
(math_environment (math_environment
(end (end
command: _ @text.math command: _ @markup.math
name: (curly_group_text (text) @text.math))) name: (curly_group_text (text) @markup.math)))
;; Sectioning ;; Sectioning
(title_declaration (title_declaration
command: _ @namespace command: _ @module
options: (brack_group (_) @text.title.1)? options: (brack_group (_) @markup.heading.1)?
text: (curly_group (_) @text.title.1)) text: (curly_group (_) @markup.heading.1))
(author_declaration (author_declaration
command: _ @namespace command: _ @module
authors: (curly_group_author_list authors: (curly_group_author_list
((author)+ @text.title.1))) ((author)+ @markup.heading.1)))
(chapter (chapter
command: _ @namespace command: _ @module
toc: (brack_group (_) @text.title.2)? toc: (brack_group (_) @markup.heading.2)?
text: (curly_group (_) @text.title.2)) text: (curly_group (_) @markup.heading.2))
(part (part
command: _ @namespace command: _ @module
toc: (brack_group (_) @text.title.2)? toc: (brack_group (_) @markup.heading.2)?
text: (curly_group (_) @text.title.2)) text: (curly_group (_) @markup.heading.2))
(section (section
command: _ @namespace command: _ @module
toc: (brack_group (_) @text.title.3)? toc: (brack_group (_) @markup.heading.3)?
text: (curly_group (_) @text.title.3)) text: (curly_group (_) @markup.heading.3))
(subsection (subsection
command: _ @namespace command: _ @module
toc: (brack_group (_) @text.title.4)? toc: (brack_group (_) @markup.heading.4)?
text: (curly_group (_) @text.title.4)) text: (curly_group (_) @markup.heading.4))
(subsubsection (subsubsection
command: _ @namespace command: _ @module
toc: (brack_group (_) @text.title.5)? toc: (brack_group (_) @markup.heading.5)?
text: (curly_group (_) @text.title.5)) text: (curly_group (_) @markup.heading.5))
(paragraph (paragraph
command: _ @namespace command: _ @module
toc: (brack_group (_) @text.title.6)? toc: (brack_group (_) @markup.heading.6)?
text: (curly_group (_) @text.title.6)) text: (curly_group (_) @markup.heading.6))
(subparagraph (subparagraph
command: _ @namespace command: _ @module
toc: (brack_group (_) @text.title.6)? toc: (brack_group (_) @markup.heading.6)?
text: (curly_group (_) @text.title.6)) text: (curly_group (_) @markup.heading.6))
;; Beamer frames ;; Beamer frames
(generic_environment (generic_environment
(begin (begin
name: (curly_group_text name: (curly_group_text
(text) @text.environment.name) (text) @markup.environment.name)
(#any-of? @text.environment.name "frame")) (#any-of? @markup.environment.name "frame"))
. .
(curly_group (_) @text.title)) (curly_group (_) @markup.heading))
((generic_command ((generic_command
command: (command_name) @_name command: (command_name) @_name
arg: (curly_group arg: (curly_group
(text) @text.title)) (text) @markup.heading))
(#eq? @_name "\\frametitle")) (#eq? @_name "\\frametitle"))
;; Formatting ;; Formatting
(text_mode (text_mode
content: (curly_group (_) @text)) content: (curly_group (_) @none @spell))
((generic_command ((generic_command
command: (command_name) @_name command: (command_name) @_name
arg: (curly_group (_) @text.emphasis)) arg: (curly_group (_) @markup.italic))
(#eq? @_name "\\emph")) (#eq? @_name "\\emph"))
((generic_command ((generic_command
command: (command_name) @_name command: (command_name) @_name
arg: (curly_group (_) @text.emphasis)) arg: (curly_group (_) @markup.italic))
(#any-of? @_name "\\textit" "\\mathit")) (#any-of? @_name "\\textit" "\\mathit"))
((generic_command ((generic_command
command: (command_name) @_name command: (command_name) @_name
arg: (curly_group (_) @text.strong)) arg: (curly_group (_) @markup.strong))
(#any-of? @_name "\\textbf" "\\mathbf")) (#any-of? @_name "\\textbf" "\\mathbf"))
((generic_command ((generic_command
command: (command_name) @_name command: (command_name) @_name
. .
arg: (curly_group (_) @text.uri)) arg: (curly_group (_) @markup.link.url))
(#any-of? @_name "\\url" "\\href")) (#any-of? @_name "\\url" "\\href"))
;; File inclusion commands ;; File inclusion commands
(class_include (class_include
command: _ @include command: _ @keyword.import
path: (curly_group_path) @string) path: (curly_group_path) @string)
(package_include (package_include
command: _ @include command: _ @keyword.import
paths: (curly_group_path_list) @string) paths: (curly_group_path_list) @string)
(latex_include (latex_include
command: _ @include command: _ @keyword.import
path: (curly_group_path) @string) path: (curly_group_path) @string)
(import_include (import_include
command: _ @include command: _ @keyword.import
directory: (curly_group_path) @string directory: (curly_group_path) @string
file: (curly_group_path) @string) file: (curly_group_path) @string)
(bibtex_include (bibtex_include
command: _ @include command: _ @keyword.import
path: (curly_group_path) @string) path: (curly_group_path) @string)
(biblatex_include (biblatex_include
"\\addbibresource" @include "\\addbibresource" @keyword.import
glob: (curly_group_glob_pattern) @string.regex) glob: (curly_group_glob_pattern) @string.regexp)
(graphics_include (graphics_include
command: _ @include command: _ @keyword.import
path: (curly_group_path) @string) path: (curly_group_path) @string)
(tikz_library_import (tikz_library_import
command: _ @include command: _ @keyword.import
paths: (curly_group_path_list) @string) paths: (curly_group_path_list) @string)
(text) @spell (text) @spell

View file

@ -23,11 +23,11 @@
(option_value) (option_value)
(check_in) (check_in)
(check_out) (check_out)
] @text.literal ] @markup.raw
((account) @field) ((account) @variable.member)
"include" @include "include" @keyword.import
[ [
"account" "account"

View file

@ -34,23 +34,23 @@
"transition" "transition"
] @keyword.function ] @keyword.function
"import" @include "import" @keyword.import
"return" @keyword.return "return" @keyword.return
(return_arrow) @punctuation.delimiter (return_arrow) @punctuation.delimiter
"for" @repeat "for" @keyword.repeat
[ [
"else" "else"
"if" "if"
] @conditional ] @keyword.conditional
[ [
(ternary_if) (ternary_if)
(ternary_else) (ternary_else)
] @conditional.ternary ] @keyword.conditional.ternary
[ "(" ")" "{" "}" "[" "]" ] @punctuation.bracket [ "(" ")" "{" "}" "[" "]" ] @punctuation.bracket
@ -118,11 +118,11 @@
] @string.special ] @string.special
;record declaration ;record declaration
(record_declaration (identifier) @field) (record_declaration (identifier) @variable.member)
;struct component ;struct component
(struct_component_declaration (struct_component_declaration
(identifier) @field) (identifier) @variable.member)
(type) @type (type) @type
@ -140,7 +140,7 @@
(record_type (record_type
(locator (locator
(identifier) @field)) (identifier) @variable.member))
(transition_declaration (transition_declaration
name: (identifier) @function.builtin) name: (identifier) @function.builtin)
@ -159,13 +159,13 @@
(method_call (method_call
. (_) . (_)
. (identifier) @method.call) . (identifier) @function.method.call)
(function_parameter (function_parameter
(identifier) @parameter) (identifier) @variable.parameter)
(struct_declaration (struct_declaration
name: (identifier) @field) name: (identifier) @variable.member)
(variable_declaration (variable_declaration
(identifier_or_identifiers (identifier_or_identifiers

View file

@ -13,13 +13,13 @@
; Conditionals ; Conditionals
(conditional_expression [ "?" ":" ] @conditional.ternary) (conditional_expression [ "?" ":" ] @keyword.conditional.ternary)
; Variables ; Variables
(symbol) @variable (symbol) @variable
(filename) @string.special @text.underline (filename) @string.special.path
; Functions ; Functions
@ -27,8 +27,8 @@
function: (symbol) @function.call) function: (symbol) @function.call)
((call_expression ((call_expression
function: (symbol) @preproc) function: (symbol) @keyword.directive)
(#eq? @preproc "DEFINED")) (#eq? @keyword.directive "DEFINED"))
((call_expression ((call_expression
function: (symbol) @function.builtin) function: (symbol) @function.builtin)
@ -52,7 +52,7 @@
[ [
"ORIGIN" "org" "o" "ORIGIN" "org" "o"
"LENGTH" "len" "l" "LENGTH" "len" "l"
] @field.builtin ] @variable.member.builtin
; Constants ; Constants
@ -80,7 +80,7 @@
; Exceptions ; Exceptions
"ASSERT" @exception "ASSERT" @keyword.exception
[ [
"/DISCARD/" "/DISCARD/"

Some files were not shown because too many files have changed in this diff Show more