diff --git a/syntax/python.vim b/syntax/python.vim index bdc9033..27681c3 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -78,7 +78,7 @@ syn keyword pythonOperator and in is not or " we provide a dummy group here to avoid crashing pyrex.vim. syn keyword pythonInclude import syn keyword pythonImport import -syn match pythonIdentifier '\v[a-zA-Z_][a-zA-Z0-9_]*' nextgroup=pythonFunctionArgs +syn match pythonIdentifier '\v[a-zA-Z_][a-zA-Z0-9_]*' syn match pythonRaiseFromStatement '\' syn match pythonImport '^\s*\zsfrom\>' @@ -89,28 +89,26 @@ if s:Python2Syntax() syn keyword pythonStatement print endif syn keyword pythonImport as - syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' nextgroup=pythonFunctionArgs display contained + syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' display contained else syn keyword pythonStatement as nonlocal syn match pythonStatement '\v\.@' - syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' nextgroup=pythonFunctionArgs display contained + syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' display contained syn match pythonStatement '\' nextgroup=pythonFunction skipwhite syn match pythonStatement '\' syn match pythonStatement '\' syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonBuiltinObj,pythonBuiltinFunc endif -syn region pythonFunctionArgs start='('rs=s+1 end=')'re=e-1 contains=pythonFunctionArgs,pythonFunctionKwargs,pythonRepeat,pythonClassVar,pythonConditional,pythonComment,pythonOperator,pythonNumber,pythonNumberError,pythonFloat,pythonHexNumber,pythonStatement,pythonOctNumber,pythonString,pythonRawString,pythonUniString,pythonExClass,pythonUniRawString,pythonNumber,pythonRawString,pythonBytes,pythonBuiltinObj,pythonNone,pythonBuiltinFunc,pythonBoolean nextgroup=pythonRaiseFromStatement display contained -syn match pythonFunctionKwargs /\i\+\ze=/ display contained " " Decorators (new in Python 2.4) " syn match pythonDecorator '^\s*\zs@' display nextgroup=pythonDottedName skipwhite if s:Python2Syntax() - syn match pythonDottedName '[a-zA-Z_][a-zA-Z0-9_]*\%(\.[a-zA-Z_][a-zA-Z0-9_]*\)*' display contained nextgroup=pythonFunctionArgs + syn match pythonDottedName '[a-zA-Z_][a-zA-Z0-9_]*\%(\.[a-zA-Z_][a-zA-Z0-9_]*\)*' display contained else - syn match pythonDottedName '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\)*' display contained nextgroup=pythonFunctionArgs + syn match pythonDottedName '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\)*' display contained endif syn match pythonDot '\.' display containedin=pythonDottedName @@ -332,7 +330,7 @@ if s:Enabled('g:python_highlight_builtin_objs') syn keyword pythonNone None syn keyword pythonBoolean True False syn keyword pythonBuiltinObj Ellipsis NotImplemented - syn match pythonBuiltinObj '\v\.@' nextgroup=pythonFunctionArgs + syn match pythonBuiltinObj '\v\.@' syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__ syn keyword pythonBuiltinObj __loader__ __spec__ __path__ __cached__ endif @@ -353,7 +351,7 @@ if s:Enabled('g:python_highlight_builtin_funcs') let s:funcs_re .= '|ascii|exec|memoryview|print' endif - execute 'syn match pythonBuiltinFunc ''\v\.@'' nextgroup=pythonFunctionArgs' + execute 'syn match pythonBuiltinFunc ''\v\.@''' unlet s:funcs_re endif @@ -370,7 +368,7 @@ if s:Enabled('g:python_highlight_exceptions') let s:exs_re .= '|BlockingIOError|ChildProcessError|ConnectionError|BrokenPipeError|ConnectionAbortedError|ConnectionRefusedError|ConnectionResetError|FileExistsError|FileNotFoundError|InterruptedError|IsADirectoryError|NotADirectoryError|PermissionError|ProcessLookupError|TimeoutError|StopAsyncIteration|ResourceWarning' endif - execute 'syn match pythonExClass ''\v\.@'' nextgroup=pythonFunctionArgs' + execute 'syn match pythonExClass ''\v\.@''' unlet s:exs_re endif @@ -463,7 +461,6 @@ if v:version >= 508 || !exists('did_python_syn_inits') HiLink pythonExClass Structure HiLink pythonClassVar Identifier - HiLink pythonFunctionKwargs Identifier delcommand HiLink endif