diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2013-10-23 18:58:46 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2013-10-23 18:58:46 +0200 |
commit | 59c3f07c1fc4baf009bd31e5bc90f7d0936ec42c (patch) | |
tree | 4e5e2bf867f6c8764927cd6af21c2d5eaf060b17 /Cython/Compiler/Scanning.py | |
parent | e564b9b902c37b9125812fc64c0d959bd8fa67e8 (diff) | |
download | cython-59c3f07c1fc4baf009bd31e5bc90f7d0936ec42c.tar.gz |
support 'rb' string prefix in addition to 'br' (Py3 allows it)
Diffstat (limited to 'Cython/Compiler/Scanning.py')
-rw-r--r-- | Cython/Compiler/Scanning.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Cython/Compiler/Scanning.py b/Cython/Compiler/Scanning.py index 8ba17c84c..93905e097 100644 --- a/Cython/Compiler/Scanning.py +++ b/Cython/Compiler/Scanning.py @@ -7,14 +7,14 @@ import os import platform import cython -cython.declare(EncodedString=object, string_prefixes=object, raw_prefixes=object, IDENT=unicode, +cython.declare(EncodedString=object, any_string_prefix=unicode, IDENT=unicode, print_function=object) from Cython import Utils from Cython.Plex.Scanners import Scanner from Cython.Plex.Errors import UnrecognizedInput from Errors import error -from Lexicon import string_prefixes, raw_prefixes, make_lexicon, IDENT +from Lexicon import any_string_prefix, make_lexicon, IDENT from Future import print_function from StringEncoding import EncodedString @@ -340,9 +340,7 @@ class PyrexScanner(Scanner): } def begin_string_action(self, text): - if text[:1] in string_prefixes: - text = text[1:] - if text[:1] in raw_prefixes: + while text[:1] in any_string_prefix: text = text[1:] self.begin(self.string_states[text]) self.produce('BEGIN_STRING') |