Merging dev into main #49

Merged
8464960 merged 260 commits from dev into main 2026-01-28 10:48:52 +00:00
Showing only changes of commit 2f7a48415b - Show all commits

View File

@@ -174,25 +174,22 @@ export function orderPhases(nodes: AppNode[],edges: Edge[]) : OrderedPhases {
if (nextPhaseNodes.length === 1 && nextNodes.length === 1) {
connections.set(currentPhase.id, nextPhaseNodes[0].id);
return nextPhase(phases.push(nextPhaseNodes[0] as PhaseNode) - 1, {phaseNodes: phases, connections: connections});
} else {
}
// handle erroneous states
if (nextNodes.length === 0) {
throw new Error(`| INVALID PROGRAM | the source handle of "${currentPhase.id}" doesn't have any outgoing connections`);
} else {
}
if (nextNodes.length > 1) {
throw new Error(`| INVALID PROGRAM | the source handle of "${currentPhase.id}" connects to too many targets`);
} else {
}
if (nextNodes[0].type === "end") {
connections.set(currentPhase.id, "end");
// returns the final output of the function
return {phaseNodes: phases, connections: connections};
} else {
}
throw new Error(`| INVALID PROGRAM | the node "${nextNodes[0].id}" that "${currentPhase.id}" connects to is not a phase or end node`);
}
}
}
}
}
// initializes the Map describing the connections between phase nodes
// we need this Map to make sure we preserve this information,
// so we don't need to do checks on the entire set of edges in further stages of the reduction algorithm