on master help sign in
Change python highlights.scm to more fully utilize the themes.
a6da99aZeddicus414
runtime/queries/python/highlights.scm+33−18
@@ -1,10 +1,19 @@
1; Identifier naming conventions
1; Identifier naming conventions
2
2
3+((identifier) @constant
4+ (#match? @constant "^[A-Z_]*$"))
5+
3((identifier) @constructor
6((identifier) @constructor
4 (#match? @constructor "^[A-Z]"))
7 (#match? @constructor "^[A-Z]"))
5
8
9+; Types
10+
6−((identifier) @constant
11+((identifier) @type
7− (#match? @constant "^[A-Z][A-Z_]*$"))
12+ (#match?
13+ @type
14+ "^(bool|bytes|dict|float|frozenset|int|list|set|str|tuple)$"))
15+
16+(type (identifier)) @type
8
17
9; Builtin functions
18; Builtin functions
10
19
@@ -12,7 +21,7 @@
12 function: (identifier) @function.builtin)
21 function: (identifier) @function.builtin)
13 (#match?
22 (#match?
14 @function.builtin
23 @function.builtin
15− "^(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|__import__)$"))
24+ "^(abs|all|any|ascii|bin|breakpoint|bytearray|callable|chr|classmethod|compile|complex|delattr|dir|divmod|enumerate|eval|exec|filter|format|getattr|globals|hasattr|hash|help|hex|id|input|isinstance|issubclass|iter|len|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|setattr|slice|sorted|staticmethod|sum|super|type|vars|zip|__import__)$"))
16
25
17; Function calls
26; Function calls
18
27
@@ -30,7 +39,6 @@
30
39
31(identifier) @variable
40(identifier) @variable
32(attribute attribute: (identifier) @variable.other.member)
41(attribute attribute: (identifier) @variable.other.member)
33−(type (identifier) @type)
34
42
35; Literals
43; Literals
36
44
@@ -81,41 +89,48 @@
81 ">>"
89 ">>"
82 "|"
90 "|"
83 "~"
91 "~"
84− "and"
85− "in"
86− "is"
87− "not"
88− "or"
89] @operator
92] @operator
90
93
91[
94[
92 "as"
95 "as"
93 "assert"
96 "assert"
94− "async"
95 "await"
97 "await"
96 "break"
98 "break"
97− "class"
98 "continue"
99 "continue"
99− "def"
100− "del"
101 "elif"
100 "elif"
102 "else"
101 "else"
103 "except"
102 "except"
104− "exec"
105 "finally"
103 "finally"
106 "for"
104 "for"
107 "from"
105 "from"
108− "global"
109 "if"
106 "if"
110 "import"
107 "import"
111− "lambda"
112− "nonlocal"
113 "pass"
108 "pass"
114− "print"
115 "raise"
109 "raise"
116 "return"
110 "return"
117 "try"
111 "try"
118 "while"
112 "while"
119 "with"
113 "with"
120 "yield"
114 "yield"
115+] @keyword.control
116+
117+(for_statement "in" @keyword.control)
118+(for_in_clause "in" @keyword.control)
119+
120+[
121+ "and"
122+ "async"
123+ "class"
124+ "def"
125+ "del"
126+ "exec"
127+ "global"
128+ "in"
129+ "is"
130+ "lambda"
131+ "nonlocal"
132+ "not"
133+ "or"
134+ "print"
121] @keyword
135] @keyword
136+