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

Function SubString

engine/source/testing/googleTest/scripts/pump.py:208–223  ·  view source on GitHub ↗

Returns a substring in lines.

(lines, start, end)

Source from the content-addressed store, hash-verified

206
207
208def SubString(lines, start, end):
209 """Returns a substring in lines."""
210
211 if end == Eof():
212 end = Cursor(len(lines) - 1, len(lines[-1]))
213
214 if start >= end:
215 return ''
216
217 if start.line == end.line:
218 return lines[start.line][start.column:end.column]
219
220 result_lines = ([lines[start.line][start.column:]] +
221 lines[start.line + 1:end.line] +
222 [lines[end.line][:end.column]])
223 return ''.join(result_lines)
224
225
226def StripMetaComments(str):

Callers 3

MakeTokenFunction · 0.85
ParseFunction · 0.85
TokenizeLinesFunction · 0.85

Calls 3

EofFunction · 0.85
CursorClass · 0.85
joinMethod · 0.45

Tested by

no test coverage detected