From 1b30f1f546b0eeb1ae8d6b1b6d36ebfca4cb8a70 Mon Sep 17 00:00:00 2001 From: Semyon Maryasin Date: Mon, 23 Jan 2017 04:50:44 +0300 Subject: [PATCH 1/3] Do support underscore in numbers, pep515 (py3.6) --- syntax/python.vim | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/syntax/python.vim b/syntax/python.vim index aebb15ad..608d887f 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -250,16 +250,16 @@ endif " Numbers {{{ " =========== - syn match pythonHexError "\<0[xX]\x*[g-zG-Z]\x*[lL]\=\>" display - syn match pythonHexNumber "\<0[xX]\x\+[lL]\=\>" 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 pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display - syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display + syn match pythonHexError "\<0[xX][0-9a-fA-F_]*[g-zG-Z][0-9a-fA-F_]*[lL]\=\>" display + syn match pythonHexNumber "\<0[xX][0-9a-fA-F_]\+[lL]\=\>" display + syn match pythonOctNumber "\<0[oO][0-7_]\+[lL]\=\>" display + syn match pythonBinNumber "\<0[bB][01_]\+[lL]\=\>" display + syn match pythonNumber "\<[0-9_]\+[lLjJ]\=\>" display + syn match pythonFloat "\.[0-9_]\+\([eE][+-]\=[0-9_]\+\)\=[jJ]\=\>" display + syn match pythonFloat "\<[0-9_]\+[eE][+-]\=[0-9_]\+[jJ]\=\>" display + syn match pythonFloat "\<[0-9_]\+\.[0-9_]*\([eE][+-]\=[0-9_]\+\)\=[jJ]\=" display + syn match pythonOctError "\<0[oO]\=[0-7_]*[8-9][0-9_]*[lL]\=\>" display + syn match pythonBinError "\<0[bB][01_]*[2-9][0-9_]*[lL]\=\>" display " }}} From 12d0d60e44c9e3adef61e1553980ef730c4096ee Mon Sep 17 00:00:00 2001 From: Semyon Maryasin Date: Sat, 11 Feb 2017 20:04:35 +0300 Subject: [PATCH 2/3] Don't treat lone _ as a digit --- syntax/python.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/syntax/python.vim b/syntax/python.vim index 608d887f..317ef1d9 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -251,13 +251,13 @@ endif " =========== syn match pythonHexError "\<0[xX][0-9a-fA-F_]*[g-zG-Z][0-9a-fA-F_]*[lL]\=\>" display - syn match pythonHexNumber "\<0[xX][0-9a-fA-F_]\+[lL]\=\>" display - syn match pythonOctNumber "\<0[oO][0-7_]\+[lL]\=\>" display - syn match pythonBinNumber "\<0[bB][01_]\+[lL]\=\>" display - syn match pythonNumber "\<[0-9_]\+[lLjJ]\=\>" display - syn match pythonFloat "\.[0-9_]\+\([eE][+-]\=[0-9_]\+\)\=[jJ]\=\>" display - syn match pythonFloat "\<[0-9_]\+[eE][+-]\=[0-9_]\+[jJ]\=\>" display - syn match pythonFloat "\<[0-9_]\+\.[0-9_]*\([eE][+-]\=[0-9_]\+\)\=[jJ]\=" display + syn match pythonHexNumber "\<0[xX][0-9a-fA-F_]*[0-9a-fA-F][0-9a-fA-F_]*[lL]\=\>" display + syn match pythonOctNumber "\<0[oO][0-7_]*[0-7][0-7_]*[lL]\=\>" display + syn match pythonBinNumber "\<0[bB][01_]*[01][01_]*[lL]\=\>" display + syn match pythonNumber "\<[0-9_]*[0-9][0-9_]*[lLjJ]\=\>" display + syn match pythonFloat "\.[0-9_]*[0-9][0-9_]*\([eE][+-]\=[0-9_]*[0-9][0-9_]*\)\=[jJ]\=\>" display + syn match pythonFloat "\<[0-9_]*[0-9][0-9_]*[eE][+-]\=[0-9_]\+[jJ]\=\>" display + syn match pythonFloat "\<[0-9_]*[0-9][0-9_]*\.[0-9_]*\([eE][+-]\=[0-9_]*[0-9][0-9_]*\)\=[jJ]\=" display syn match pythonOctError "\<0[oO]\=[0-7_]*[8-9][0-9_]*[lL]\=\>" display syn match pythonBinError "\<0[bB][01_]*[2-9][0-9_]*[lL]\=\>" display From 9bd0e40d272cca1562db8643234268263fc325f2 Mon Sep 17 00:00:00 2001 From: Semyon Maryasin Date: Sat, 11 Feb 2017 20:05:54 +0300 Subject: [PATCH 3/3] Number may not start with underscore --- syntax/python.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntax/python.vim b/syntax/python.vim index 317ef1d9..090e9be1 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -254,10 +254,10 @@ endif syn match pythonHexNumber "\<0[xX][0-9a-fA-F_]*[0-9a-fA-F][0-9a-fA-F_]*[lL]\=\>" display syn match pythonOctNumber "\<0[oO][0-7_]*[0-7][0-7_]*[lL]\=\>" display syn match pythonBinNumber "\<0[bB][01_]*[01][01_]*[lL]\=\>" display - syn match pythonNumber "\<[0-9_]*[0-9][0-9_]*[lLjJ]\=\>" display + syn match pythonNumber "\<[0-9][0-9_]*[lLjJ]\=\>" display syn match pythonFloat "\.[0-9_]*[0-9][0-9_]*\([eE][+-]\=[0-9_]*[0-9][0-9_]*\)\=[jJ]\=\>" display - syn match pythonFloat "\<[0-9_]*[0-9][0-9_]*[eE][+-]\=[0-9_]\+[jJ]\=\>" display - syn match pythonFloat "\<[0-9_]*[0-9][0-9_]*\.[0-9_]*\([eE][+-]\=[0-9_]*[0-9][0-9_]*\)\=[jJ]\=" display + syn match pythonFloat "\<[0-9][0-9_]*[eE][+-]\=[0-9_]\+[jJ]\=\>" display + syn match pythonFloat "\<[0-9][0-9_]*\.[0-9_]*\([eE][+-]\=[0-9_]*[0-9][0-9_]*\)\=[jJ]\=" display syn match pythonOctError "\<0[oO]\=[0-7_]*[8-9][0-9_]*[lL]\=\>" display syn match pythonBinError "\<0[bB][01_]*[2-9][0-9_]*[lL]\=\>" display pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy