SF patch #455966: Allow leading 0 in float/imag literals.

Consequences for Jython still unknown (but raised on Jython-Dev).
This commit is contained in:
Tim Peters 2001-08-30 20:51:59 +00:00
parent 21922aa939
commit d507dab91f
5 changed files with 84 additions and 15 deletions

View file

@ -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.