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

Function parseAdditive

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

Source from the content-addressed store, hash-verified

87 }
88
89 function parseAdditive() {
90 let node = parseMultiplicative();
91 while (peek() && peek().type === 'sym' && (peek().value === '+' || peek().value === '-')) {
92 const op = peek().value;
93 eat('sym', op);
94 const right = parseMultiplicative();
95 node = { type: 'expr', op, left: node, right };
96 }
97 return node;
98 }
99
100 function parseMultiplicative() {
101 let node = parsePrimary();

Callers 1

parseExpressionFunction · 0.85

Calls 3

parseMultiplicativeFunction · 0.85
peekFunction · 0.85
eatFunction · 0.85

Tested by

no test coverage detected