MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / FindFirstInLine

Function FindFirstInLine

engine/source/testing/googleTest/scripts/pump.py:169–183  ·  view source on GitHub ↗
(line, token_table)

Source from the content-addressed store, hash-verified

167
168
169def FindFirstInLine(line, token_table):
170 best_match_start = -1
171 for (regex, token_type) in token_table:
172 m = regex.search(line)
173 if m:
174 # We found regex in lines
175 if best_match_start < 0 or m.start() < best_match_start:
176 best_match_start = m.start()
177 best_match_length = m.end() - m.start()
178 best_match_token_type = token_type
179
180 if best_match_start < 0:
181 return None
182
183 return (best_match_start, best_match_length, best_match_token_type)
184
185
186def FindFirst(lines, token_table, cursor):

Callers 1

FindFirstFunction · 0.85

Calls 2

startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected