Added support for new integer literal syntax

This commit is contained in:
Dmitry Vasiliev
2008-09-20 22:13:20 +04:00
parent bbac2dd2f8
commit 4e0828f853
3 changed files with 12 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ Revision 2.6.1 (unknown):
- Removed "OverflowWarning" (removed in Python 2.5);
- Added option "python_print_as_function" for highlight "print" as a
function;
- Added support for new integer literal syntax "0o" and "0b";
Revision 2.5.6 (2007-02-04):

View File

@@ -1,7 +1,3 @@
- Add configuration for "print" status (function or builtin)
- Integer literal support
- Python 3.0 string formatting
- Need more accurate way to handle indentation errors. For example

View File

@@ -188,14 +188,18 @@ endif
" Numbers (ints, longs, floats, complex)
syn match pythonHexNumber "\<0[xX]\x\+[lL]\=\>" display
syn match pythonHexNumber "\<0[xX]\>" display
syn match pythonOctNumber "\<0[oO]\o\+[lL]\=\>" display
syn match pythonBinNumber "\<0[bB][01]\+[lL]\=\>" display
syn match pythonNumber "\<\d\+[lLjJ]\=\>" display
syn match pythonFloat "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" display
syn match pythonFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display
syn match pythonFloat "\<\d\+\.\d*\([eE][+-]\=\d\+\)\=[jJ]\=" display
syn match pythonOctalError "\<0\o*[89]\d*[lL]\=\>" display
syn match pythonHexError "\<0[xX]\X\+[lL]\=\>" display
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display
syn match pythonHexError "\<0[xX]\x*\X\x*[lL]\=\>" display
syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display
if exists("python_highlight_builtins") && python_highlight_builtins != 0
" Builtin functions, types and objects
@@ -303,9 +307,12 @@ if version >= 508 || !exists("did_python_syn_inits")
HiLink pythonNumber Number
HiLink pythonHexNumber Number
HiLink pythonOctNumber Number
HiLink pythonBinNumber Number
HiLink pythonFloat Float
HiLink pythonOctalError Error
HiLink pythonOctError Error
HiLink pythonHexError Error
HiLink pythonBinError Error
HiLink pythonBuiltinObj Structure
HiLink pythonBuiltinFunc Function