(token: BranchOperator)
| 179 | } |
| 180 | |
| 181 | pushRootBranch(token: BranchOperator): void { |
| 182 | this.assertRangeUnset() |
| 183 | this.applyPrefixes() |
| 184 | const root = this.root! |
| 185 | this.root = undefined |
| 186 | |
| 187 | const l = this.branches.intersection |
| 188 | this.branches.intersection = l?.rawAnd(root) ?? root |
| 189 | if (l) checkWrittenIntersection(this.branches.intersection, l, root) |
| 190 | |
| 191 | if (token === "&") return |
| 192 | |
| 193 | const operand = this.branches.intersection |
| 194 | this.branches.intersection = null |
| 195 | if ( |
| 196 | !this.branches.union && |
| 197 | operand.is("unit") && |
| 198 | isEmptyObject(operand.meta) |
| 199 | ) |
| 200 | (this.branches.units ??= []).push(operand) |
| 201 | else { |
| 202 | this.unionUnits() |
| 203 | this.branches.union = this.branches.union?.rawOr(operand) ?? operand |
| 204 | } |
| 205 | |
| 206 | if (token === "|") return |
| 207 | |
| 208 | this.unionUnits() |
| 209 | |
| 210 | this.branches.pipe = |
| 211 | this.branches.pipe?.rawPipeOnce(this.branches.union!) ?? |
| 212 | this.branches.union |
| 213 | this.branches.union = null |
| 214 | } |
| 215 | |
| 216 | parseUntilFinalizer(): RootedRuntimeState { |
| 217 | return parseUntilFinalizer(new RuntimeState(this.sc, this.ctx)) |
no test coverage detected