MCPcopy Create free account
hub / github.com/IENT/YUView / parseClosingWhile

Method parseClosingWhile

tools/standardTextToCode/parseTables.py:334–354  ·  view source on GitHub ↗
(self, table, tableIndex : int)

Source from the content-addressed store, hash-verified

332 if (not text.startswith("do")):
333 raise SyntaxError("Do container does not start with do")
334 def parseClosingWhile(self, table, tableIndex : int):
335 t0_full = table.cell(0, tableIndex).text
336 text = t0_full.strip()
337 if (not text.startswith("} while")):
338 raise SyntaxError("do does not end with while")
339 start = text.find("(")
340 end = text.rfind(")")
341 if (start == -1 or end == -1):
342 raise SyntaxError("Do ... while loop does not contain brackets")
343 self.condition = cleanCondition(text[start+1:end])
344 t1 = table.cell(0, tableIndex+1).text.strip()
345 try:
346 t2 = table.cell(0, tableIndex+2).text.strip()
347 if (t2 == t1):
348 # Skip identical entries. This may be the aforementioned glitch.
349 tableIndex += 1
350 except IndexError:
351 # No more data
352 pass
353 tableIndex += 2
354 return tableIndex
355 def getDoText(self):
356 spaces = ""
357 for _ in range(self.parent.depth):

Callers 1

parseChildrenMethod · 0.95

Calls 1

cleanConditionFunction · 0.85

Tested by

no test coverage detected