aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/foam/highlights.scm
blob: 9c96f196e258265ca37c77762259e58522bbe47f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
; Comments
(comment) @comment @spell

; Generic Key-value pairs and dictionary keywords
(key_value
  keyword: (identifier) @function)

(dict
  key: (identifier) @type)

; Macros
(macro
  "$" @keyword.conditional
  (prev_scope)* @keyword.conditional
  (identifier)* @module)

; Directives
"#" @keyword.conditional

(preproc_call
  directive: (identifier)* @keyword.conditional
  argument: (identifier)* @module)

((preproc_call
  argument: (identifier)* @module) @keyword.conditional
  (#eq? @keyword.conditional "ifeq"))

((preproc_call) @keyword.conditional
  (#any-of? @keyword.conditional "else" "endif"))

; Literals
(number_literal) @number.float

(string_literal) @string

(escape_sequence) @string.escape

(boolean) @boolean

; Treat [m^2 s^-2] the same as if it was put in numbers format
(dimensions
  dimension: (identifier) @number.float)

; Punctuation
[
  "("
  ")"
  "["
  "]"
  "{"
  "}"
  "#{"
  "#}"
  "|-"
  "-|"
  "<!--("
  ")-->"
  "$$"
] @punctuation.bracket

";" @punctuation.delimiter

((identifier) @constant.builtin
  (#any-of? @constant.builtin "uniform" "non-uniform" "and" "or"))