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

Class ContainerWhile

tools/standardTextToCode/parseTables.py:309–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307 return f"{spaces}if({self.condition})"
308
309class ContainerWhile(Container):
310 def __init__(self, parent):
311 super().__init__(parent)
312 self.condition = None
313 def fromText(self, text : str):
314 if (not text.startswith("while")):
315 raise SyntaxError("While container does not start with while")
316 start = text.find("(")
317 end = text.rfind(")")
318 if (start == -1 or end == -1):
319 raise SyntaxError("While loop does not contain brackets")
320 self.condition = cleanCondition(text[start+1:end])
321 def __str__(self):
322 spaces = ""
323 for _ in range(self.parent.depth):
324 spaces += " "
325 return f"{spaces}while({self.condition})"
326
327class ContainerDo(Container):
328 def __init__(self, parent):

Callers 1

parseChildrenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected