MCPcopy Create free account
hub / github.com/danja/dogalog / nodeToTerm

Function nodeToTerm

src/prolog/parser.js:209–217  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

207 }
208
209 function nodeToTerm(node) {
210 if (!node) throw new Error('Expected term');
211 if (node.type === 'expr') {
212 return { type: 'expr', op: node.op, left: nodeToTerm(node.left), right: nodeToTerm(node.right) };
213 }
214 if (node.type === 'comparison') return convertComparison(node);
215 if (node.type === 'goal') return nodeToTerm(node.goal);
216 return node;
217 }
218
219 const clauses = [];
220 while (index < tokens.length) {

Callers 1

convertComparisonFunction · 0.85

Calls 1

convertComparisonFunction · 0.85

Tested by

no test coverage detected