(self, text : str)
| 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): |
no test coverage detected