MCPcopy
hub / github.com/witheve/Eve / preJoinAccept

Function preJoinAccept

src/runtime/join.ts:829–854  ·  view source on GitHub ↗
(multiIndex: MultiIndex, providers : ProposalProvider[], vars : Variable[], prefix: any[] = [])

Source from the content-addressed store, hash-verified

827}
828
829function preJoinAccept(multiIndex: MultiIndex, providers : ProposalProvider[], vars : Variable[], prefix: any[] = []) {
830 let ix = 0;
831 let presolved = 0;
832 for(let value of prefix) {
833 let solvingFor = vars[ix];
834 if(value !== undefined && vars[ix] !== undefined) {
835 presolved++;
836 for(let provider of providers) {
837 if(!provider.accept(multiIndex, prefix, solvingFor, false, true)) {
838 return {accepted: false, presolved};
839 }
840 }
841 }
842 ix++;
843 }
844 // we still need to do a single prejoin pass to make sure that any nots
845 // that may have no external dependencies are given a chance to end this
846 // evaluation
847 let fakeVar = new Variable(0);
848 for(let provider of providers) {
849 if(provider instanceof NotScan && !provider.accept(multiIndex, prefix, fakeVar, false, true)) {
850 return {accepted: false, presolved};
851 }
852 }
853 return {accepted: true, presolved};
854}
855
856export interface JoinOptions {
857 single?: boolean,

Callers 2

acceptMethod · 0.85
joinFunction · 0.85

Calls 1

acceptMethod · 0.65

Tested by

no test coverage detected