Browse Source

Mark None as Python builtin object along with True and False

More specifically, they are "built-in constants":

  https://docs.python.org/2/library/constants.html#built-in-consts
Alois Mahdal 9 years ago
parent
commit
60a7b5c3d2
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      syntax/python.vim

+ 3
- 4
syntax/python.vim View File

176
   syn keyword pythonImport      as
176
   syn keyword pythonImport      as
177
   syn match   pythonFunction    "[a-zA-Z_][a-zA-Z0-9_]*" display contained
177
   syn match   pythonFunction    "[a-zA-Z_][a-zA-Z0-9_]*" display contained
178
 else
178
 else
179
-  syn keyword pythonStatement   as nonlocal None
179
+  syn keyword pythonStatement   as nonlocal
180
   syn match   pythonStatement   "\<yield\s\+from\>" display
180
   syn match   pythonStatement   "\<yield\s\+from\>" display
181
-  syn keyword pythonBoolean     True False
181
+  syn keyword pythonBuiltinObj  None True False
182
   syn match   pythonFunction    "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
182
   syn match   pythonFunction    "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
183
   syn keyword pythonStatement   await
183
   syn keyword pythonStatement   await
184
   syn match   pythonStatement   "\<async\s\+def\>" nextgroup=pythonFunction skipwhite
184
   syn match   pythonStatement   "\<async\s\+def\>" nextgroup=pythonFunction skipwhite
399
 
399
 
400
 if s:Enabled("g:python_highlight_builtin_objs")
400
 if s:Enabled("g:python_highlight_builtin_objs")
401
   if s:Python2Syntax()
401
   if s:Python2Syntax()
402
-    syn keyword pythonBuiltinObj	None
403
-    syn keyword pythonBoolean		True False
402
+    syn keyword pythonBuiltinObj	None False True
404
   endif
403
   endif
405
   syn keyword pythonBuiltinObj	Ellipsis NotImplemented
404
   syn keyword pythonBuiltinObj	Ellipsis NotImplemented
406
   syn keyword pythonBuiltinObj	__debug__ __doc__ __file__ __name__ __package__
405
   syn keyword pythonBuiltinObj	__debug__ __doc__ __file__ __name__ __package__