예제 #1
0
 def get_token(pos=False):
     try:
         tok_type, tok_string, (srow, scol), (erow, ecol), line = next(tokens)
     except StopIteration:
         return tokenize.ENDMARKER, ''
     if pos:
         return tok_type, tok_string, (srow, scol), (erow, ecol)
     else:
         return tok_type, tok_string
예제 #2
0
 def get_token(pos=False):
     try:
         tok_type, tok_string, (srow, scol), (erow,
                                              ecol), line = next(tokens)
     except StopIteration:
         return tokenize.ENDMARKER, ''
     if pos:
         return tok_type, tok_string, (srow, scol), (erow, ecol)
     else:
         return tok_type, tok_string