Exemplo n.º 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
Exemplo n.º 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