summaryrefslogtreecommitdiffstats
path: root/Lib/tokenize.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-08-30 20:51:59 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-08-30 20:51:59 (GMT)
commitd507dab91f9790a24bd53d41d7fcf52fe89a6eff (patch)
treebfd040b35180f81cb9b0376df6070d91a08e7c57 /Lib/tokenize.py
parent21922aa9393996b1ea3f324759e158ec623acb43 (diff)
downloadcpython-d507dab91f9790a24bd53d41d7fcf52fe89a6eff.zip
cpython-d507dab91f9790a24bd53d41d7fcf52fe89a6eff.tar.gz
cpython-d507dab91f9790a24bd53d41d7fcf52fe89a6eff.tar.bz2
SF patch #455966: Allow leading 0 in float/imag literals.
Consequences for Jython still unknown (but raised on Jython-Dev).
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r--Lib/tokenize.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index b952b36..da2bcd2 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -56,9 +56,9 @@ Decnumber = r'[1-9]\d*[lL]?'
Intnumber = group(Hexnumber, Octnumber, Decnumber)
Exponent = r'[eE][-+]?\d+'
Pointfloat = group(r'\d+\.\d*', r'\.\d+') + maybe(Exponent)
-Expfloat = r'[1-9]\d*' + Exponent
+Expfloat = r'\d+' + Exponent
Floatnumber = group(Pointfloat, Expfloat)
-Imagnumber = group(r'0[jJ]', r'[1-9]\d*[jJ]', Floatnumber + r'[jJ]')
+Imagnumber = group(r'\d+[jJ]', Floatnumber + r'[jJ]')
Number = group(Imagnumber, Floatnumber, Intnumber)
# Tail end of ' string.