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

Function parseMultiplicative

src/prolog/parser.js:100–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98 }
99
100 function parseMultiplicative() {
101 let node = parsePrimary();
102 while (peek() && peek().type === 'sym' && (peek().value === '*' || peek().value === '/')) {
103 const op = peek().value;
104 eat('sym', op);
105 const right = parsePrimary();
106 node = { type: 'expr', op, left: node, right };
107 }
108 return node;
109 }
110
111 function parsePrimary() {
112 const tok = peek();

Callers 1

parseAdditiveFunction · 0.85

Calls 3

parsePrimaryFunction · 0.85
peekFunction · 0.85
eatFunction · 0.85

Tested by

no test coverage detected