summaryrefslogtreecommitdiffstats
path: root/queries/robot/highlights.scm
blob: b9db0246872dc4ac8a82aa0f5b576e5e3bf10b27 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
[
  (comment)
  (extra_text)
] @comment @spell

[
  (section_header)
  (setting_statement)
  (keyword_setting)
  (test_case_setting)
] @keyword

(variable_definition
  (variable_name) @variable)

(keyword_definition
  (name) @function)

(test_case_definition
  (name) @function)

(keyword_invocation
  (keyword) @function.call)

(ellipses) @punctuation.delimiter

(text_chunk) @string

(inline_python_expression) @string.special

[
  (scalar_variable)
  (list_variable)
  (dictionary_variable)
] @variable

; Control structures
[
  "FOR"
  "IN"
  "IN RANGE"
  "IN ENUMERATE"
  "IN ZIP"
  (break_statement)
  (continue_statement)
] @keyword.repeat

(for_statement
  "END" @keyword.repeat)

"WHILE" @keyword.repeat

(while_statement
  "END" @keyword.repeat)

[
  "IF"
  "ELSE IF"
] @keyword.conditional

(if_statement
  "END" @keyword.conditional)

(if_statement
  (else_statement
    "ELSE" @keyword.conditional))

[
  "TRY"
  "EXCEPT"
  "FINALLY"
] @keyword.exception

(try_statement
  "END" @keyword.exception)

(try_statement
  (else_statement
    "ELSE" @keyword.exception))