@@ -178,14 +178,14 @@ if s:Python2Syntax()
178178 " Python 2 strings
179179 syn region pythonString start =+ [bB]\= '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
180180 syn region pythonString start =+ [bB]\= "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
181- syn region pythonString start =+ [bB]\= """+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
182- syn region pythonString start =+ [bB]\= '''+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
181+ syn region pythonString start =+ [bB]\= """+ skip = + \\ " + end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
182+ syn region pythonString start =+ [bB]\= '''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
183183else
184184 " Python 3 byte strings
185185 syn region pythonBytes start =+ [bB]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesError,pythonBytesContent,@Spell
186186 syn region pythonBytes start =+ [bB]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesError,pythonBytesContent,@Spell
187- syn region pythonBytes start =+ [bB]'''+ end =+ '''+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest,pythonSpaceError,@Spell
188- syn region pythonBytes start =+ [bB]"""+ end =+ """+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest2,pythonSpaceError,@Spell
187+ syn region pythonBytes start =+ [bB]'''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest,pythonSpaceError,@Spell
188+ syn region pythonBytes start =+ [bB]"""+ skip = + \\ " + end =+ """+ keepend contains =pythonBytesError,pythonBytesContent,pythonDocTest2,pythonSpaceError,@Spell
189189
190190 syn match pythonBytesError ' .\+ ' display contained
191191 syn match pythonBytesContent ' [\u 0000-\u 00ff]\+ ' display contained contains =pythonBytesEscape,pythonBytesEscapeError
@@ -209,27 +209,27 @@ if s:Python2Syntax()
209209 " Python 2 Unicode strings
210210 syn region pythonUniString start =+ [uU]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
211211 syn region pythonUniString start =+ [uU]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
212- syn region pythonUniString start =+ [uU]'''+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
213- syn region pythonUniString start =+ [uU]"""+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
212+ syn region pythonUniString start =+ [uU]'''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
213+ syn region pythonUniString start =+ [uU]"""+ skip = + \\ " + end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
214214else
215215 " Python 3 strings
216216 syn region pythonString start =+ '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
217217 syn region pythonString start =+ "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
218- syn region pythonString start =+ '''+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
219- syn region pythonString start =+ """+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
218+ syn region pythonString start =+ '''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
219+ syn region pythonString start =+ """+ skip = + \\ " + end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
220220
221221 syn region pythonFString start =+ [fF]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
222222 syn region pythonFString start =+ [fF]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
223- syn region pythonFString start =+ [fF]'''+ end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
224- syn region pythonFString start =+ [fF]"""+ end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
223+ syn region pythonFString start =+ [fF]'''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
224+ syn region pythonFString start =+ [fF]"""+ skip = + \\ " + end =+ """+ keepend contains =pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
225225endif
226226
227227if s: Python2Syntax ()
228228 " Python 2 Unicode raw strings
229229 syn region pythonUniRawString start =+ [uU][rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
230230 syn region pythonUniRawString start =+ [uU][rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
231- syn region pythonUniRawString start =+ [uU][rR]'''+ end =+ '''+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell
232- syn region pythonUniRawString start =+ [uU][rR]"""+ end =+ """+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell
231+ syn region pythonUniRawString start =+ [uU][rR]'''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell
232+ syn region pythonUniRawString start =+ [uU][rR]"""+ skip = + \\ " + end =+ """+ keepend contains =pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell
233233
234234 syn match pythonUniRawEscape ' \% ([^\\ ]\% (\\\\\) *\)\@ <=\\ u\x\{ 4}' display contained
235235 syn match pythonUniRawEscapeError ' \% ([^\\ ]\% (\\\\\) *\)\@ <=\\ u\x\{ ,3}\X ' display contained
@@ -239,18 +239,18 @@ endif
239239if s: Python2Syntax ()
240240 syn region pythonRawString start =+ [bB]\= [rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
241241 syn region pythonRawString start =+ [bB]\= [rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
242- syn region pythonRawString start =+ [bB]\= [rR]'''+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
243- syn region pythonRawString start =+ [bB]\= [rR]"""+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
242+ syn region pythonRawString start =+ [bB]\= [rR]'''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
243+ syn region pythonRawString start =+ [bB]\= [rR]"""+ skip = + \\ " + end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
244244else
245245 syn region pythonRawString start =+ [rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
246246 syn region pythonRawString start =+ [rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
247- syn region pythonRawString start =+ [rR]'''+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
248- syn region pythonRawString start =+ [rR]"""+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
247+ syn region pythonRawString start =+ [rR]'''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
248+ syn region pythonRawString start =+ [rR]"""+ skip = + \\ " + end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
249249
250250 syn region pythonRawBytes start =+ [bB][rR]'+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
251251 syn region pythonRawBytes start =+ [bB][rR]"+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
252- syn region pythonRawBytes start =+ [bB][rR]'''+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
253- syn region pythonRawBytes start =+ [bB][rR]"""+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
252+ syn region pythonRawBytes start =+ [bB][rR]'''+ skip = + \\ ' + end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
253+ syn region pythonRawBytes start =+ [bB][rR]"""+ skip = + \\ " + end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
254254endif
255255
256256syn match pythonRawEscape + \\ ['"]+ display transparent contained
@@ -293,8 +293,8 @@ endif
293293
294294if s: Enabled (' g:python_highlight_doctests' )
295295 " DocTests
296- syn region pythonDocTest start =' ^\s *>>>' end =+ '''+ he =s - 1 end =' ^\s *$' contained
297- syn region pythonDocTest2 start =' ^\s *>>>' end =+ """+ he =s - 1 end =' ^\s *$' contained
296+ syn region pythonDocTest start =' ^\s *>>>' skip = + \\ ' + end =+ '''+ he =s - 1 end =' ^\s *$' contained
297+ syn region pythonDocTest2 start =' ^\s *>>>' skip = + \\ " + end =+ """+ he =s - 1 end =' ^\s *$' contained
298298endif
299299
300300"
0 commit comments