@@ -222,13 +222,18 @@ else
222
222
syn region pythonRawString start =+ [rR]'''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
223
223
syn region pythonRawString start =+ [rR]"""+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
224
224
225
+ syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
226
+ syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
227
+ syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
228
+ syn region pythonRawFString start =+ \% ([fF][rR]\| [rR][fF]\) """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
229
+
225
230
syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) '+ skip =+ \\\\\|\\ '\|\\ $+ excludenl end =+ '+ end =+ $+ keepend contains =pythonRawEscape,@Spell
226
231
syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) "+ skip =+ \\\\\|\\ "\|\\ $+ excludenl end =+ "+ end =+ $+ keepend contains =pythonRawEscape,@Spell
227
232
syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) '''+ skip =+ \\ '+ end =+ '''+ keepend contains =pythonDocTest,pythonSpaceError,@Spell
228
233
syn region pythonRawBytes start =+ \% ([bB][rR]\| [rR][bB]\) """+ skip =+ \\ "+ end =+ """+ keepend contains =pythonDocTest2,pythonSpaceError,@Spell
229
234
endif
230
235
231
- syn match pythonRawEscape + \\ ['"]+ display transparent contained
236
+ syn match pythonRawEscape + \\ ['"]+ display contained
232
237
233
238
if s: Enabled (' g:python_highlight_string_formatting' )
234
239
" % operator string formatting
@@ -247,9 +252,9 @@ if s:Enabled('g:python_highlight_string_format')
247
252
syn match pythonStrFormat ' {{\| }}' contained containedin =pythonString,pythonUniString,pythonUniRawString,pythonRawString
248
253
syn match pythonStrFormat ' {\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\)\=\% (\.\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\[\% (\d\+\| [^!:\} ]\+\)\]\) *\% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }' contained containedin =pythonString,pythonUniString,pythonUniRawString,pythonRawString
249
254
else
250
- syn match pythonStrFormat " {{\| }}" contained containedin =pythonString,pythonRawString,pythonFString
255
+ syn match pythonStrFormat " {{\| }}" contained containedin =pythonString,pythonRawString,pythonFString,pythonRawFString
251
256
syn match pythonStrFormat " {\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\)\=\% (\.\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\[\% (\d\+\| [^!:\} ]\+\)\]\) *\% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }" contained containedin =pythonString,pythonRawString
252
- syn region pythonStrInterpRegion start =" {" he =e + 1 ,rs =e + 1 end =" \% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }" hs =s - 1 ,re =s - 1 extend contained containedin =pythonFString contains =pythonStrInterpRegion,@pythonExpression
257
+ syn region pythonStrInterpRegion start =" {" he =e + 1 ,rs =e + 1 end =" \% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }" hs =s - 1 ,re =s - 1 extend contained containedin =pythonFString,pythonRawFString contains =pythonStrInterpRegion,@pythonExpression
253
258
endif
254
259
endif
255
260
@@ -424,6 +429,7 @@ if v:version >= 508 || !exists('did_python_syn_inits')
424
429
425
430
HiLink pythonString String
426
431
HiLink pythonRawString String
432
+ HiLink pythonRawEscape Special
427
433
428
434
HiLink pythonUniEscape Special
429
435
HiLink pythonUniEscapeError Error
@@ -441,6 +447,7 @@ if v:version >= 508 || !exists('did_python_syn_inits')
441
447
HiLink pythonBytesEscape Special
442
448
HiLink pythonBytesEscapeError Error
443
449
HiLink pythonFString String
450
+ HiLink pythonRawFString String
444
451
HiLink pythonStrInterpRegion Special
445
452
endif
446
453
0 commit comments