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

Method fromText

tools/standardTextToCode/parseTables.py:286–298  ·  view source on GitHub ↗
(self, text : str)

Source from the content-addressed store, hash-verified

284 self.isElseIf = False
285 self.isElse = False
286 def fromText(self, text : str):
287 if (not text.startswith("if") and not text.startswith("else if") and not text.startswith("} else") and not text.startswith("else")):
288 raise SyntaxError("If container does not start with if or else if")
289 if (text.startswith("else if")):
290 self.isElseIf = True
291 if (text.startswith("} else") or text.startswith("else")):
292 self.isElse = True
293 return
294 start = text.find("(")
295 end = text.rfind(")")
296 if (start == -1 or end == -1):
297 raise SyntaxError("If condition does not contain brackets")
298 self.condition = cleanCondition(text[start+1:end])
299 def __str__(self):
300 spaces = ""
301 for _ in range(self.parent.depth):

Callers 1

parseChildrenMethod · 0.95

Calls 1

cleanConditionFunction · 0.85

Tested by

no test coverage detected