Sets up internal state so that new nodes are added to a subtree of the current node. The conn_type specifies how the sub-tree is joined to the existing children.
(self, conn_type)
| 355 | self.connector = self.default |
| 356 | |
| 357 | def start_subtree(self, conn_type): |
| 358 | """ |
| 359 | Sets up internal state so that new nodes are added to a subtree of the |
| 360 | current node. The conn_type specifies how the sub-tree is joined to the |
| 361 | existing children. |
| 362 | """ |
| 363 | if len(self.children) == 1: |
| 364 | self.connector = conn_type |
| 365 | elif self.connector != conn_type: |
| 366 | self.children = [ |
| 367 | self._new_instance(self.children, self.connector, self.negated) |
| 368 | ] |
| 369 | self.connector = conn_type |
| 370 | self.negated = False |
| 371 | |
| 372 | self.subtree_parents.append( |
| 373 | self.__class__(self.children, self.connector, self.negated) |
| 374 | ) |
| 375 | self.connector = self.default |
| 376 | self.negated = False |
| 377 | self.children = [] |
| 378 | |
| 379 | def end_subtree(self): |
| 380 | """ |
no test coverage detected