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

Method accept

src/runtime/join.ts:322–341  ·  view source on GitHub ↗
(multiIndex: MultiIndex, prefix, solvingFor, force?)

Source from the content-addressed store, hash-verified

320 // of the value given all the filled variables. If not, we check if there's an index that
321 // could provide us the rest of it.
322 accept(multiIndex: MultiIndex, prefix, solvingFor, force?) {
323 // we only need to check if we're solving for a variable that is actually part of our
324 // scan
325 if(!force && !this.vars[solvingFor.id]) return true;
326 let resolved = this.resolve(prefix);
327 let [e,a,v,node] = resolved;
328 // check if we're fully resolved and if so lookup to see if we accept
329 if(e !== undefined && a !== undefined && v !== undefined) {
330 if(this.node !== undefined) {
331 //multidb
332 return multiIndex.contains(this.scopes,e,a,v,node) !== undefined;
333 }
334 return multiIndex.contains(this.scopes,e,a,v) !== undefined;
335 }
336 // we can check if we get a proposal with a cardinality to determine if we can
337 // accept this prefix. If we don't it means there are no values for the remaining
338 // vars in the indexes.
339 let proposal = this.getProposal(multiIndex, resolved);
340 return proposal && proposal.cardinality > 0;
341 }
342}
343
344//---------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

resolveMethod · 0.95
getProposalMethod · 0.95
containsMethod · 0.80

Tested by

no test coverage detected