[pypy-svn] r45342 - pypy/dist/pypy/interpreter/pyparser
jacob at codespeak.net
jacob at codespeak.net
Thu Jul 26 14:05:25 CEST 2007
Author: jacob
Date: Thu Jul 26 14:05:23 2007
New Revision: 45342
Modified:
pypy/dist/pypy/interpreter/pyparser/future.py
Log:
Small simplification of character lookups.
Modified: pypy/dist/pypy/interpreter/pyparser/future.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/future.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/future.py Thu Jul 26 14:05:23 2007
@@ -109,7 +109,7 @@
return
elif c == '\\':
# Deal with linefeeds
- if self.s[self.pos] not in ['\r', '\n']:
+ if self.s[self.pos] not in '\r\n':
self.pos += 1
continue
elif self.s[self.pos] == '\r':
@@ -120,7 +120,7 @@
else: # '\n' is the only option left
self.pos += 1
continue
- elif c in ['\r', '\n']:
+ elif c in '\r\n':
# Syntax error
return
@@ -137,7 +137,7 @@
self.pos += 1
self.consumeWhitespace()
self.start()
- elif self.s[self.pos] in ['\r', '\n']:
+ elif self.s[self.pos] in '\r\n':
self.pos += 1
if self.s[self.pos] == '\n':
self.pos += 1
@@ -145,7 +145,7 @@
def consumeComment(self):
self.pos += 1
- while self.s[self.pos] not in ['\r', '\n']:
+ while self.s[self.pos] not in '\r\n':
self.pos += 1
self.consumeEmptyLine()
More information about the Pypy-commit
mailing list