Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

parseRightOperand

function parseRightOperand(
parselet,
parser,
builder
): void;

Defined in: packages/engine/src/parser/Parselet.ts:50

Parse the right operand of parselet at the power its associativity needs.

The parser’s infix loop stops when the next operator’s power is not above the minimum it was given. Parsing the right operand at the operator’s own power therefore stops at the next occurrence of it, and a chain groups left; one below keeps consuming, and it groups right. A parselet that calls this in place of parser.parseExpression(this.bindingPower, builder) gets both behaviours from the one declaration.

ParameterType
parseletInfixParselet
parserPrecedenceParser
builderBytecodeBuilder

void