diff --git a/pdl-live-react/src/pdl_ast_utils.ts b/pdl-live-react/src/pdl_ast_utils.ts index 9cb36189d..7e3c59631 100644 --- a/pdl-live-react/src/pdl_ast_utils.ts +++ b/pdl-live-react/src/pdl_ast_utils.ts @@ -217,6 +217,10 @@ export function map_block_children( .with({ kind: "include" }, (block) => block) .with({ kind: "import" }, (block) => block) .with({ kind: "aggregator" }, (block) => block) + .with({ kind: "factor" }, (block) => { + const factor = f_expr(block.factor) + return { ...block, factor } + }) .with({ kind: P.nullish }, (block) => block) // @ts-expect-error: TODO .exhaustive() @@ -313,6 +317,9 @@ export function iter_block_children( .with({ kind: "include" }, () => {}) .with({ kind: "import" }, () => {}) .with({ kind: "aggregator" }, () => {}) + .with({ kind: "factor" }, (block) => { + if (block.factor) f(block.factor) + }) .with({ kind: undefined }, () => {}) // @ts-expect-error: TODO .exhaustive() diff --git a/pdl-live-react/src/view/timeline/model.ts b/pdl-live-react/src/view/timeline/model.ts index 41b762cd0..da95a3ff6 100644 --- a/pdl-live-react/src/view/timeline/model.ts +++ b/pdl-live-react/src/view/timeline/model.ts @@ -152,6 +152,7 @@ export function childrenOf(block: NonScalarPdlBlock) { .with({ kind: "empty" }, (data) => data.defs ? Object.values(data.defs) : [], ) + .with({ kind: "factor" }, () => []) .with({ kind: "error" }, () => []) // TODO show errors in trace .with({ kind: P.nullish }, () => []) // @ts-expect-error: TODO