INNER CODE UNIT · Python

best_match_start

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

  best_match_start = -1
  for (regex, token_type) in token_table:
    m = regex.search(line)
    if m:
      # We found regex in lines
      if best_match_start < 0 or m.start() < best_match_start:
        best_match_start = m.start()
        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."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…