(js: CombinatorCompiler, node: MorphNode)
| 1189 | |
| 1190 | // a callback is read where it's called, as it may be set once this has loaded |
| 1191 | const writeMorph = (js: CombinatorCompiler, node: MorphNode): string => |
| 1192 | writeCall( |
| 1193 | "morphing", |
| 1194 | node.head ? readChecker(js, node.head) : "0", |
| 1195 | `[${node.travMorphs |
| 1196 | .slice(node.head ? 1 : 0) |
| 1197 | .map(step => { |
| 1198 | if (!hasArkKind(step, "root")) { |
| 1199 | return isKeyword(step) ? |
| 1200 | js.ref(step) |
| 1201 | : `data => ${js.ref(step)}(data)` |
| 1202 | } |
| 1203 | // a morph references only its last step |
| 1204 | js.link.byId[step.id] ??= step |
| 1205 | return writeCall( |
| 1206 | "piped", |
| 1207 | readChecker(js, step), |
| 1208 | step.reportsPred ? "1" : undefined |
| 1209 | ) |
| 1210 | }) |
| 1211 | .join(", ")}]` |
| 1212 | ) |
| 1213 | |
| 1214 | // what narrows a checker after it, which one that transforms writes apart, so |
| 1215 | // a program narrowing no transform ships only the other |
no test coverage detected