Home | History | Annotate | Download | only in python2.7

Lines Matching refs:pos

292         pos, max = 0, len(line)
299 pos = end = endmatch.end(0)
318 while pos < max: # measure leading whitespace
319 if line[pos] == ' ':
321 elif line[pos] == '\t':
323 elif line[pos] == '\f':
327 pos += 1
328 if pos == max:
331 if line[pos] in '#\r\n': # skip comments or blank lines
332 if line[pos] == '#':
333 comment_token = line[pos:].rstrip('\r\n')
334 nl_pos = pos + len(comment_token)
336 (lnum, pos), (lnum, pos + len(comment_token)), line)
340 yield ((NL, COMMENT)[line[pos] == '#'], line[pos:],
341 (lnum, pos), (lnum, len(line)), line)
346 yield (INDENT, line[:pos], (lnum, 0), (lnum, pos), line)
351 ("<tokenize>", lnum, pos, line))
353 yield (DEDENT, '', (lnum, pos), (lnum, pos), line)
360 while pos < max:
361 pseudomatch = pseudoprog.match(line, pos)
364 spos, epos, pos = (lnum, start), (lnum, end), end
380 endmatch = endprog.match(line, pos)
382 pos = endmatch.end(0)
383 token = line[start:pos]
384 yield (STRING, token, spos, (lnum, pos), line)
413 yield (ERRORTOKEN, line[pos],
414 (lnum, pos), (lnum, pos+1), line)
415 pos += 1