(data: unknown, ctx: InternalTraversal)
| 252 | } |
| 253 | |
| 254 | tTransform(data: unknown, ctx: InternalTraversal): unknown { |
| 255 | const errN = ctx.errN |
| 256 | let result = this.head?.tfs ? transform(ctx, this.head, data) : data |
| 257 | if (ctx.errN > errN) return data |
| 258 | const morphs = this.travMorphs |
| 259 | for (let i = this.head ? 1 : 0; i < morphs.length; i++) { |
| 260 | const morph = morphs[i] |
| 261 | if (hasArkKind(morph, "root")) { |
| 262 | result = pipe(ctx, morph, result) |
| 263 | if (ctx._errors !== undefined && result === ctx._errors) return data |
| 264 | continue |
| 265 | } |
| 266 | const morphed = |
| 267 | this.contextFree[i] ? |
| 268 | (morph as Morph.ContextFree)(result as never) |
| 269 | : callMorph(ctx, this.saying[i] ?? morph, result, this.meta.label) |
| 270 | if (morphed instanceof ArkErrors) { |
| 271 | addErrors(ctx, morphed) |
| 272 | return data |
| 273 | } |
| 274 | result = morphed |
| 275 | } |
| 276 | return result |
| 277 | } |
| 278 | |
| 279 | /** Check if the morphs of r are equal to those of this node */ |
| 280 | override sameMorphs(r: MorphNode): boolean { |
nothing calls this directly
no test coverage detected