11{
2- "$schema" : " https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json" ,
3- "name" : " reStructuredPython" ,
4- "patterns" : [
5- {
6- "include" : " #keywords"
7- },
8- {
9- "include" : " #functions"
10- },
11- {
12- "include" : " #variables"
13- },
14- {
15- "include" : " #numbers"
16- },
17- {
18- "include" : " #strings"
19- },
20- {
21- "include" : " #comments"
22- },
23- {
24- "include" : " #braces"
25- },
26- {
27- "include" : " #parentheses"
28- }
29- ],
30- "repository" : {
31- "keywords" : {
32- "patterns" : [
33- {
34- "name" : " keyword.control.restructuredpython" ,
35- "match" : " \\ b(if|for|while|def|elif|else|class|with|import|include)\\ b"
36- }
37- ]
38- },
39- "functions" : {
40- "patterns" : [
41- {
42- "name" : " entity.name.function.restructuredpython" ,
43- "match" : " \\ bdef\\ s+([A-Za-z_][A-Za-z0-9_]*)\\ b"
44- }
45- ]
46- },
2+ "$schema" : " https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json" ,
3+ "name" : " reStructuredPython" ,
4+ "patterns" : [
5+ { "include" : " #storage" },
6+ { "include" : " #keywords" },
7+ { "include" : " #functions" },
8+ { "include" : " #variables" },
9+ { "include" : " #numbers" },
10+ { "include" : " #strings" },
11+ { "include" : " #comments" },
12+ { "include" : " #braces" },
13+ { "include" : " #parentheses" }
14+ ],
15+ "repository" : {
16+ "storage" : {
17+ "patterns" : [
18+ {
19+ "name" : " storage.control.restructuredpython" ,
20+ "match" : " \\ b(if|for|while|def|elif|else|class|with|import|include|match|case|None|and|as|global|from|in|is|lambda|nonlocal|not|or)\\ b|\\ |>"
21+
22+ }
23+ ]
24+ },
25+ "keywords" : {
26+ "patterns" : [
27+ {
28+ "name" : " keyword.control.restructuredpython" ,
29+ "match" : " \\ b(True|False|pass|assert|async|await|break|continue|del|raise|return|yield)\\ b"
30+ }
31+ ]
32+ },
33+ "functions" : {
34+ "patterns" : [
35+ {
36+ "name" : " entity.name.function.restructuredpython" ,
37+ "match" : " \\ bdef\\ s+([A-Za-z_][A-Za-z0-9_]*)\\ b"
38+ }
39+ ]
40+ },
4741 "variables" : {
4842 "patterns" : [
4943 {
50- "name" : " variable.other.restructuredpython" ,
51- "match" : " \\ b[A-Za-z_][A-Za-z0-9_]*\\ b"
52- }
53- ]
54- },
55- "numbers" : {
56- "patterns" : [
57- {
58- "name" : " constant.numeric.restructuredpython" ,
59- "match" : " \\ b\\ d+\\ b"
60- }
61- ]
62- },
63- "strings" : {
64- "patterns" : [
65- {
66- "name" : " string.quoted.double.restructuredpython" ,
67- "begin" : " \"\"\" " ,
68- "end" : " \"\"\" " ,
69- "patterns" : [
70- {
71- "name" : " constant.character.escape.restructuredpython" ,
72- "match" : " \\\\ ."
73- }
74- ]
75- },
76- {
77- "name" : " string.quoted.single.restructuredpython" ,
78- "begin" : " '''" ,
79- "end" : " '''" ,
80- "patterns" : [
81- {
82- "name" : " constant.character.escape.restructuredpython" ,
83- "match" : " \\\\ ."
84- }
85- ]
86- },
87- {
88- "name" : " string.quoted.double.singleline.restructuredpython" ,
89- "begin" : " \" " ,
90- "end" : " \" " ,
91- "patterns" : [
92- {
93- "name" : " constant.character.escape.restructuredpython" ,
94- "match" : " \\\\ ."
95- }
96- ]
97- },
98- {
99- "name" : " string.quoted.single.singleline.restructuredpython" ,
100- "begin" : " '" ,
101- "end" : " '" ,
102- "patterns" : [
103- {
104- "name" : " constant.character.escape.restructuredpython" ,
105- "match" : " \\\\ ."
106- }
107- ]
44+ "name" : " variable.restructuredpython" ,
45+ "match" : " (?<!\\ .|\\ d)\\ b[A-Za-z_][A-Za-z0-9_]*\\ b(?!\\ s*\\ ()"
10846 }
10947 ]
11048 },
111- "comments" : {
112- "patterns" : [
113- {
114- "name" : " comment.line.restructuredpython" ,
115- "begin" : " #" ,
116- "end" : " $"
117- },
118- {
119- "name" : " comment.block.documentation.restructuredpython" ,
120- "begin" : " \"\"\" " ,
121- "end" : " \"\"\" " ,
122- "patterns" : [
123- {
124- "name" : " comment.block.documentation.restructuredpython" ,
125- "match" : " .+"
126- }
127- ]
128- },
129- {
130- "name" : " comment.block.documentation.restructuredpython" ,
131- "begin" : " '''" ,
132- "end" : " '''" ,
133- "patterns" : [
134- {
135- "name" : " comment.block.documentation.restructuredpython" ,
136- "match" : " .+"
137- }
138- ]
139- }
140- ]
141- },
142- "braces" : {
143- "patterns" : [
144- {
145- "name" : " punctuation.definition.block.restructuredpython" ,
146- "match" : " [{}]"
147- }
148- ]
149- },
150- "parentheses" : {
151- "patterns" : [
152- {
153- "name" : " punctuation.definition.group.restructuredpython" ,
154- "match" : " [()]"
155- }
156- ]
157- }
158- },
159- "scopeName" : " source.restructuredpython"
160- }
161-
49+ "numbers" : {
50+ "patterns" : [
51+ {
52+ "name" : " constant.numeric.restructuredpython" ,
53+ "match" : " \\ b\\ d+\\ b"
54+ }
55+ ]
56+ },
57+ "strings" : {
58+ "patterns" : [
59+ {
60+ "name" : " string.quoted.double.restructuredpython" ,
61+ "begin" : " \"\"\" " ,
62+ "end" : " \"\"\" " ,
63+ "patterns" : [
64+ {
65+ "name" : " constant.character.escape.restructuredpython" ,
66+ "match" : " \\\\ ."
67+ }
68+ ]
69+ },
70+ {
71+ "name" : " string.quoted.single.restructuredpython" ,
72+ "begin" : " '''" ,
73+ "end" : " '''" ,
74+ "patterns" : [
75+ {
76+ "name" : " constant.character.escape.restructuredpython" ,
77+ "match" : " \\\\ ."
78+ }
79+ ]
80+ },
81+ {
82+ "name" : " string.quoted.double.singleline.restructuredpython" ,
83+ "begin" : " \" " ,
84+ "end" : " \" " ,
85+ "patterns" : [
86+ {
87+ "name" : " constant.character.escape.restructuredpython" ,
88+ "match" : " \\\\ ."
89+ }
90+ ]
91+ },
92+ {
93+ "name" : " string.quoted.single.singleline.restructuredpython" ,
94+ "begin" : " '" ,
95+ "end" : " '" ,
96+ "patterns" : [
97+ {
98+ "name" : " constant.character.escape.restructuredpython" ,
99+ "match" : " \\\\ ."
100+ }
101+ ]
102+ }
103+ ]
104+ },
105+ "comments" : {
106+ "patterns" : [
107+ {
108+ "name" : " comment.line.restructuredpython" ,
109+ "begin" : " #" ,
110+ "end" : " $"
111+ },
112+ {
113+ "name" : " comment.block.documentation.restructuredpython" ,
114+ "begin" : " \"\"\" " ,
115+ "end" : " \"\"\" " ,
116+ "patterns" : [
117+ {
118+ "name" : " comment.block.documentation.restructuredpython" ,
119+ "match" : " .+"
120+ }
121+ ]
122+ },
123+ {
124+ "name" : " comment.block.documentation.restructuredpython" ,
125+ "begin" : " '''" ,
126+ "end" : " '''" ,
127+ "patterns" : [
128+ {
129+ "name" : " comment.block.documentation.restructuredpython" ,
130+ "match" : " .+"
131+ }
132+ ]
133+ },
134+ {
135+ "name" : " comment.block.restructuredpython" ,
136+ "begin" : " /\\ *" ,
137+ "end" : " \\ */" ,
138+ "beginCaptures" : {
139+ "0" : {
140+ "name" : " punctuation.definition.comment.begin.restructuredpython"
141+ }
142+ },
143+ "endCaptures" : {
144+ "0" : {
145+ "name" : " punctuation.definition.comment.end.restructuredpython"
146+ }
147+ },
148+ "patterns" : [
149+ {
150+ "name" : " comment.block.documentation.restructuredpython" ,
151+ "match" : " /\\ *\\ *"
152+ }
153+ ]
154+ }
155+ ]
156+ },
157+ "braces" : {
158+ "patterns" : [
159+ {
160+ "name" : " punctuation.definition.block.restructuredpython" ,
161+ "match" : " [{}]"
162+ }
163+ ]
164+ },
165+ "parentheses" : {
166+ "patterns" : [
167+ {
168+ "name" : " punctuation.definition.group.restructuredpython" ,
169+ "match" : " [()]"
170+ }
171+ ]
172+ }
173+ },
174+ "scopeName" : " source.restructuredpython"
175+ }
0 commit comments