String literal identifiers ending in newlines.
authorRobert Bradshaw <robertwb@math.washington.edu>
Tue, 11 May 2010 04:18:46 +0000 (21:18 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Tue, 11 May 2010 04:18:46 +0000 (21:18 -0700)
Cython/Compiler/Code.py
tests/run/strliterals.pyx

index 323d2c79bd46a637b3bab26b1c5d23f44d606957..bc20ec4ad4a2e26bd138dbfa9ce4593a80665d54 100644 (file)
@@ -289,7 +289,7 @@ class PyObjectConst(object):
 
 possible_unicode_identifier = re.compile(ur"(?![0-9])\w+$", re.U).match
 possible_bytes_identifier = re.compile(r"(?![0-9])\w+$".encode('ASCII')).match
-nice_identifier = re.compile('^[a-zA-Z0-9_]+$').match
+nice_identifier = re.compile(r'\A[a-zA-Z0-9_]+\Z').match
 find_alphanums = re.compile('([a-zA-Z0-9]+)').findall
 
 class StringConst(object):
index 68719f4c4e6de15a7450ab9244edf75fc92830b1..1a344ac102f939452721f93b90a919fc209a2fef 100644 (file)
@@ -103,6 +103,9 @@ __doc__ = ur"""
     True
     >>> len(u6)
     7
+    
+    >>> newlines == "Aaa\n"
+    True
 """
 
 import sys
@@ -127,3 +130,5 @@ u3 = ur"abc\x11"
 u4 = Ur"abc\x11"
 u5 = uR"abc\x11"
 u6 = UR"abc\x11"
+
+newlines = "Aaa\n"