Show
Ignore:
Timestamp:
03/06/11 16:30:15 (12 months ago)
Author:
Menno Smits <menno@…>
Branch:
default
Message:

Halfway through re-working how BODY/BODYSTRUCTURE is handled so the parser doesn't have to treat paren lists without whitespace between them specially.

The failing tests light the way.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imapclient/response_lexer.py

    r204 r229  
    9595                        yield nextchar + read_until(stream_i, nextchar) 
    9696                    else: 
    97                         # Other punctuation, eg. "(" 
     97                        # Other punctuation, eg. "(". This ends the current token. 
    9898                        if token: 
    9999                            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 
    105101                    break 
    106102            else: 
     
    165161        self.pushed.append(item) 
    166162 
    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 default 
    173         return self.pushed[-1] 
    174  
    175163         
    176164