Skip to content

Commit 1df5e5a

Browse files
committed
Fix parsing floats with no number trailing the .
Fixes vim-python#41
1 parent 41ad513 commit 1df5e5a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

syntax/python.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ else
327327

328328
syn match pythonFloat '\.\d\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=\>' display
329329
syn match pythonFloat '\<\d\%([_0-9]*\d\)\=[eE][+-]\=\d\%([_0-9]*\d\)\=[jJ]\=\>' display
330-
syn match pythonFloat '\<\d\%([_0-9]*\d\)\=\.\d\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=' display
330+
syn match pythonFloat '\<\d\%([_0-9]*\d\)\=\.\d\=\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=' display
331331
endif
332332

333333
"

tests/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ async def Test
186186

187187
# Numbers
188188

189-
0 1 2 9 10 0x1f .3 12.34 0j 124j 34.2E-3 0b10 0o77 1023434 0x0
189+
0 1 2 9 10 0x1f 1. .3 12.34 0j 124j 34.2E-3 0b10 0o77 1023434 0x0
190190
1_1 1_1.2_2 1_2j 0x_1f 0x1_f 34_56e-3 34_56e+3_1 0o7_7
191191

192192
# Erroneous numbers

0 commit comments

Comments
 (0)