on master help sign in
nix: fix highlighting rules
1fe3273Timothy DeHerrera
runtime/queries/nix/highlights.scm+22−13
@@ -1,16 +1,20 @@
1(comment) @comment
1(comment) @comment
2
2
3+"assert" @keyword.control.exception
4+"or" @keyword.operator
5+"rec" @keyword.control.repeat
6+
3[
7[
4 "if"
8 "if"
5 "then"
9 "then"
6 "else"
10 "else"
11+] @keyword.control.conditional
12+
13+[
7 "let"
14 "let"
8 "inherit"
15 "inherit"
9 "in"
16 "in"
10− "rec"
11 "with"
17 "with"
12− "assert"
13− "or"
14] @keyword
18] @keyword
15
19
16((identifier) @variable.builtin
20((identifier) @variable.builtin
@@ -42,14 +46,11 @@
42(integer_expression) @constant.numeric.integer
46(integer_expression) @constant.numeric.integer
43(float_expression) @constant.numeric.float
47(float_expression) @constant.numeric.float
44
48
45−(interpolation
46− "${" @punctuation.special
47− "}" @punctuation.special) @embedded
48−
49(escape_sequence) @constant.character.escape
49(escape_sequence) @constant.character.escape
50
50
51(function_expression
51(function_expression
52 universal: (identifier) @variable.parameter
52 universal: (identifier) @variable.parameter
53+ "@"? @punctuation.delimiter
53)
54)
54
55
55(formal
56(formal
@@ -57,11 +58,15 @@
57 "?"? @punctuation.delimiter)
58 "?"? @punctuation.delimiter)
58
59
59(select_expression
60(select_expression
60− attrpath: (attrpath (identifier)) @variable.other.member)
61+ attrpath: (attrpath attr: (identifier)) @variable.other.member)
62+
63+(interpolation
64+ "${" @punctuation.special
65+ "}" @punctuation.special) @embedded
61
66
62(apply_expression
67(apply_expression
63 function: [
68 function: [
64− (variable_expression (identifier)) @function
69+ (variable_expression name: (identifier) @function)
65 (select_expression
70 (select_expression
66 attrpath: (attrpath
71 attrpath: (attrpath
67 attr: (identifier) @function .))])
72 attr: (identifier) @function .))])
@@ -72,14 +77,18 @@
72(binary_expression
77(binary_expression
73 operator: _ @operator)
78 operator: _ @operator)
74
79
75−(variable_expression (identifier) @variable)
80+(variable_expression name: (identifier) @variable)
76
81
77(binding
82(binding
78− attrpath: (attrpath (identifier)) @variable.other.member)
83+ attrpath: (attrpath attr: (identifier)) @variable.other.member)
79
84
80−(identifier) @variable.other.member
85+(inherit_from attrs: (inherited_attrs attr: (identifier) @variable))
81
86
87+(has_attr_expression
88+ expression: (_)
89+ "?" @operator
90+ attrpath: (attrpath
82−(inherit_from attrs: (inherited_attrs attr: (identifier) @variable.other.member) )
91+ attr: (identifier) @variable.other.member))
83
92
84[
93[
85 ";"
94 ";"