[Python-checkins] r55863 - sandbox/trunk/2to3/pgen2/tokenize.py
georg.brandl
python-checkins at python.org
Mon Jun 11 00:20:03 CEST 2007
Author: georg.brandl
Date: Mon Jun 11 00:19:57 2007
New Revision: 55863
Modified:
sandbox/trunk/2to3/pgen2/tokenize.py
Log:
Allow 0B and 0O prefixes in pgen2 tokenizer.
Modified: sandbox/trunk/2to3/pgen2/tokenize.py
==============================================================================
--- sandbox/trunk/2to3/pgen2/tokenize.py (original)
+++ sandbox/trunk/2to3/pgen2/tokenize.py Mon Jun 11 00:19:57 2007
@@ -46,9 +46,9 @@
Ignore = Whitespace + any(r'\\\r?\n' + Whitespace) + maybe(Comment)
Name = r'[a-zA-Z_]\w*'
-Binnumber = r'0b[01]*'
+Binnumber = r'0[bB][01]*'
Hexnumber = r'0[xX][\da-fA-F]*[lL]?'
-Octnumber = r'0[o]?[0-7]*[lL]?'
+Octnumber = r'0[oO]?[0-7]*[lL]?'
Decnumber = r'[1-9]\d*[lL]?'
Intnumber = group(Binnumber, Hexnumber, Octnumber, Decnumber)
Exponent = r'[eE][-+]?\d+'
More information about the Python-checkins
mailing list