Changeset 229:85569119917a for imapclient/response_lexer.py
- Timestamp:
- 03/06/11 16:30:15 (12 months ago)
- Branch:
- default
- Files:
-
- 1 modified
-
imapclient/response_lexer.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
imapclient/response_lexer.py
r204 r229 95 95 yield nextchar + read_until(stream_i, nextchar) 96 96 else: 97 # Other punctuation, eg. "(" 97 # Other punctuation, eg. "(". This ends the current token. 98 98 if token: 99 99 yield token 100 if nextchar == ')' and stream_i.peek() == '(': 101 stream_i.next() # Read the '(' 102 yield ')(' 103 else: 104 yield nextchar # yield the punctuation 100 yield nextchar 105 101 break 106 102 else: … … 165 161 self.pushed.append(item) 166 162 167 def peek(self, default=NO_MORE):168 if not self.pushed:169 try:170 self.pushed.append(self.it.next())171 except StopIteration:172 return default173 return self.pushed[-1]174 175 163 176 164
