@@ -16,6 +16,9 @@ call pymode#default('g:pymode_syntax_all', 1)
1616
1717" Highlight 'print' as function
1818call pymode#default (" g:pymode_syntax_print_as_function" , 0 )
19+ "
20+ " Highlight 'async/await' keywords
21+ call pymode#default (" g:pymode_syntax_highlight_async_await" , g: pymode_syntax_all )
1922
2023" Highlight '=' operator
2124call pymode#default (' g:pymode_syntax_highlight_equal_operator' , g: pymode_syntax_all )
7578 syn keyword pythonStatement yield
7679 syn keyword pythonLambdaExpr lambda
7780 syn keyword pythonStatement with as
78- syn keyword pythonStatement async await
7981
8082 syn keyword pythonStatement def nextgroup =pythonFunction skipwhite
81- syn match pythonStatement " \< async\s\+ def\> " nextgroup =pythonFunction skipwhite
82- syn match pythonStatement " \< async\s\+ with\> " display
83- syn match pythonStatement " \< async\s\+ for\> " nextgroup =pythonRepeat skipwhite
8483 syn match pythonFunction " \% (\% (def\s\| @\)\s *\)\@ <=\h\% (\w\|\.\) *" contained nextgroup =pythonVars
8584 syn region pythonVars start =" (" skip =+ \( ".*"\| '.*'\) + end =" )" contained contains =pythonParameters transparent keepend
8685 syn match pythonParameters " [^,]*" contained contains =pythonParam skipwhite
@@ -105,6 +104,13 @@ endif
105104 syn keyword pythonStatement print
106105 endif
107106
107+ if g: pymode_syntax_highlight_async_await
108+ syn keyword pythonStatement async await
109+ syn match pythonStatement " \< async\s\+ def\> " nextgroup =pythonFunction skipwhite
110+ syn match pythonStatement " \< async\s\+ with\> " display
111+ syn match pythonStatement " \< async\s\+ for\> " nextgroup =pythonRepeat skipwhite
112+ endif
113+
108114 if g: pymode_syntax_highlight_equal_operator
109115 syn match pythonExtraOperator " \% (=\) "
110116 endif
0 commit comments