@@ -164,16 +164,16 @@ endif
164
164
165
165
if s: Python2Syntax ()
166
166
" Python 2 strings
167
- syn region pythonString start =+ [bB]\= '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
168
- syn region pythonString start =+ [bB]\= "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
169
- syn region pythonString start =+ [bB]\= """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
170
- syn region pythonString start =+ [bB]\= '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
167
+ syn region pythonString matchgroup = pythonQuotes start =+ [bB]\= '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
168
+ syn region pythonString matchgroup = pythonQuotes start =+ [bB]\= "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
169
+ syn region pythonString matchgroup = pythonQuotes start =+ [bB]\= """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
170
+ syn region pythonString matchgroup = pythonQuotes start =+ [bB]\= '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
171
171
else
172
172
" Python 3 byte strings
173
- syn region pythonBytes start =+ [bB]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesError,pythonBytesContent,@Spell
174
- syn region pythonBytes start =+ [bB]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesError,pythonBytesContent,@Spell
175
- syn region pythonBytes start =+ [bB]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest,pythonSpaceError,@Spell
176
- syn region pythonBytes start =+ [bB]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest2,pythonSpaceError,@Spell
173
+ syn region pythonBytes matchgroup = pythonQuotes start =+ [bB]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesError,pythonBytesContent,@Spell
174
+ syn region pythonBytes matchgroup = pythonQuotes start =+ [bB]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesError,pythonBytesContent,@Spell
175
+ syn region pythonBytes matchgroup = pythonQuotes start =+ [bB]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest,pythonSpaceError,@Spell
176
+ syn region pythonBytes matchgroup = pythonQuotes start =+ [bB]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest2,pythonSpaceError,@Spell
177
177
178
178
syn match pythonBytesError ' .\+ ' display contained
179
179
syn match pythonBytesContent ' [\u 0000-\u 00ff]\+ ' display contained contains =pythonBytesEscape,pythonBytesEscapeError
@@ -195,55 +195,55 @@ syn match pythonUniEscapeError '\\N{[^A-Z ]\+}' display contained
195
195
196
196
if s: Python2Syntax ()
197
197
" Python 2 Unicode strings
198
- syn region pythonUniString start =+ [uU]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
199
- syn region pythonUniString start =+ [uU]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
200
- syn region pythonUniString start =+ [uU]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
201
- syn region pythonUniString start =+ [uU]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
198
+ syn region pythonUniString matchgroup = pythonQuotes start =+ [uU]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
199
+ syn region pythonUniString matchgroup = pythonQuotes start =+ [uU]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
200
+ syn region pythonUniString matchgroup = pythonQuotes start =+ [uU]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
201
+ syn region pythonUniString matchgroup = pythonQuotes start =+ [uU]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
202
202
else
203
203
" Python 3 strings
204
- syn region pythonString start =+ '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
205
- syn region pythonString start =+ "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
206
- syn region pythonString start =+ '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
207
- syn region pythonString start =+ """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
208
-
209
- syn region pythonFString start =+ [fF]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
210
- syn region pythonFString start =+ [fF]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
211
- syn region pythonFString start =+ [fF]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
212
- syn region pythonFString start =+ [fF]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
204
+ syn region pythonString matchgroup = pythonQuotes start =+ '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
205
+ syn region pythonString matchgroup = pythonQuotes start =+ "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
206
+ syn region pythonString matchgroup = pythonQuotes start =+ '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
207
+ syn region pythonString matchgroup = pythonQuotes start =+ """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
208
+
209
+ syn region pythonFString matchgroup = pythonQuotes start =+ [fF]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
210
+ syn region pythonFString matchgroup = pythonQuotes start =+ [fF]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
211
+ syn region pythonFString matchgroup = pythonQuotes start =+ [fF]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
212
+ syn region pythonFString matchgroup = pythonQuotes start =+ [fF]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
213
213
endif
214
214
215
215
if s: Python2Syntax ()
216
216
" Python 2 Unicode raw strings
217
- syn region pythonUniRawString start =+ [uU][rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
218
- syn region pythonUniRawString start =+ [uU][rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
219
- syn region pythonUniRawString start =+ [uU][rR]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell
220
- syn region pythonUniRawString start =+ [uU][rR]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell
217
+ syn region pythonUniRawString matchgroup = pythonQuotes start =+ [uU][rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
218
+ syn region pythonUniRawString matchgroup = pythonQuotes start =+ [uU][rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
219
+ syn region pythonUniRawString matchgroup = pythonQuotes start =+ [uU][rR]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell
220
+ syn region pythonUniRawString matchgroup = pythonQuotes start =+ [uU][rR]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell
221
221
222
222
syn match pythonUniRawEscape ' \% ([^\\ ]\% (\\\\\) *\)\@ <=\\ u\x\{ 4}' display contained
223
223
syn match pythonUniRawEscapeError ' \% ([^\\ ]\% (\\\\\) *\)\@ <=\\ u\x\{ ,3}\X ' display contained
224
224
endif
225
225
226
226
" Python 2/3 raw strings
227
227
if s: Python2Syntax ()
228
- syn region pythonRawString start =+ [bB]\= [rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
229
- syn region pythonRawString start =+ [bB]\= [rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
230
- syn region pythonRawString start =+ [bB]\= [rR]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
231
- syn region pythonRawString start =+ [bB]\= [rR]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
228
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [bB]\= [rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
229
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [bB]\= [rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
230
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [bB]\= [rR]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
231
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [bB]\= [rR]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
232
232
else
233
- syn region pythonRawString start =+ [rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
234
- syn region pythonRawString start =+ [rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
235
- syn region pythonRawString start =+ [rR]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
236
- syn region pythonRawString start =+ [rR]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
237
-
238
- syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
239
- syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
240
- syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
241
- syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
242
-
243
- syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
244
- syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
245
- syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
246
- syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
233
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
234
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
235
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [rR]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
236
+ syn region pythonRawString matchgroup = pythonQuotes start =+ [rR]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
237
+
238
+ syn region pythonRawFString matchgroup = pythonQuotes start =+ \% ([fF][rR]\| [rR][fF]\) '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
239
+ syn region pythonRawFString matchgroup = pythonQuotes start =+ \% ([fF][rR]\| [rR][fF]\) "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
240
+ syn region pythonRawFString matchgroup = pythonQuotes start =+ \% ([fF][rR]\| [rR][fF]\) '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
241
+ syn region pythonRawFString matchgroup = pythonQuotes start =+ \% ([fF][rR]\| [rR][fF]\) """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
242
+
243
+ syn region pythonRawBytes matchgroup = pythonQuotes start =+ \% ([bB][rR]\| [rR][bB]\) '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
244
+ syn region pythonRawBytes matchgroup = pythonQuotes start =+ \% ([bB][rR]\| [rR][bB]\) "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
245
+ syn region pythonRawBytes matchgroup = pythonQuotes start =+ \% ([bB][rR]\| [rR][bB]\) '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
246
+ syn region pythonRawBytes matchgroup = pythonQuotes start =+ \% ([bB][rR]\| [rR][bB]\) """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
247
247
endif
248
248
249
249
syn match pythonRawEscape + \\ ['"]+ display contained
@@ -454,6 +454,7 @@ if v:version >= 508 || !exists('did_python_syn_inits')
454
454
455
455
HiLink pythonString String
456
456
HiLink pythonRawString String
457
+ HiLink pythonQuotes String
457
458
HiLink pythonRawEscape Special
458
459
459
460
HiLink pythonUniEscape Special
0 commit comments