Fix some binding powers
This commit is contained in:
parent
2770a2de3b
commit
2b6aff0dab
1 changed files with 4 additions and 4 deletions
|
@ -77,13 +77,13 @@ const Operators: TokenHandler[] = [
|
|||
leftBindingPower: -1,
|
||||
token: MINUS_TOKEN,
|
||||
parse: (left, matched, parser) =>
|
||||
map(parser.parseSubExpression(0), (right) => ({value: -right})),
|
||||
map(parser.parseSubExpression(99), (right) => ({value: -right})),
|
||||
},
|
||||
makeInfixOp(PLUS_TOKEN, 10, 11, (left, right) => ({ value: left + right })),
|
||||
makeInfixOp(MINUS_TOKEN, 10, 11, (left, right) => ({ value: left - right })),
|
||||
makeInfixOp(TIMES_TOKEN, 10, 11, (left, right) => ({ value: left * right })),
|
||||
makeInfixOp(FLOOR_TOKEN, 10, 11, (left, right) => ({ value: Math.floor(left / right) })),
|
||||
makeInfixOp(DIV_TOKEN, 10, 11, (left, right) => ({ value: left / right })),
|
||||
makeInfixOp(TIMES_TOKEN, 20, 21, (left, right) => ({ value: left * right })),
|
||||
makeInfixOp(FLOOR_TOKEN, 20, 21, (left, right) => ({ value: Math.floor(left / right) })),
|
||||
makeInfixOp(DIV_TOKEN, 20, 21, (left, right) => ({ value: left / right })),
|
||||
];
|
||||
|
||||
const ZERO = { value: 0 };
|
||||
|
|
Loading…
Reference in a new issue