Skip to content

Commit eb44ea7

Browse files
committed
Fix pythonNumberError patterns to exclude legitimate identifiers.
* "_0" is a valid identifier!
1 parent e07541a commit eb44ea7

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
@@ -393,7 +393,7 @@ else
393393

394394
syn match pythonNumberError "\<\d[_0-9]*\D\>" display
395395
syn match pythonNumberError "\<0[_0-9]\+\>" display
396-
syn match pythonNumberError "\<\%(_[_0-9]\+\|[_0-9]\+_\)\>" display
396+
syn match pythonNumberError "\<\d[_0-9]*_\>" display
397397
syn match pythonNumber "\<\d\>" display
398398
syn match pythonNumber "\<[1-9][_0-9]*\d\>" display
399399
syn match pythonNumber "\<\d[jJ]\>" display

test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def Test
6767
# Erroneous numbers
6868

6969
077 100L 0xfffffffL 0L 08 0xk 0x 0b102 0o78 0o123LaB
70-
0_ 0_1 _0 0_x1f 0x1f_ 0_b77 0b77_ ._2 .2_ 1_j
70+
0_ 0_1 0_x1f 0x1f_ 0_b77 0b77_ .2_ 1_j
7171

7272
# Strings
7373

0 commit comments

Comments
 (0)