INNER CODE UNIT · Python

best_match_length

Squirrel-Engine/Squirrel-Engine · googletest/googlemock/scripts/pump.py:178

        best_match_length = m.end() - m.start()
        best_match_token_type = token_type

  if best_match_start < 0:
    return None

  return (best_match_start, best_match_length, best_match_token_type)


def FindFirst(lines, token_table, cursor):
  """Finds the first occurrence of any string in strings in lines."""

  start = cursor.Clone()
  cur_line_number = cursor.line
  for line in lines[start.line:]:
    if cur_line_number == start.line:
      line = line[start.column:]
    m = FindFirstInLine(line, token_table)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…