Fix binding power of * // /
This commit is contained in:
parent
21e8d95f98
commit
1078dc3653
1 changed files with 3 additions and 3 deletions
|
@ -80,13 +80,13 @@ const Operators: TokenHandler[] = [
|
|||
leftBindingPower: 20,
|
||||
token: TIMES_TOKEN,
|
||||
parse: ({ value: left }, matched, parser) =>
|
||||
map(parser.parseSubExpression(11), (right) => ({ value: left * right })),
|
||||
map(parser.parseSubExpression(21), (right) => ({ value: left * right })),
|
||||
},
|
||||
{
|
||||
leftBindingPower: 20,
|
||||
token: FLOOR_TOKEN,
|
||||
parse: ({ value: left }, matched, parser) =>
|
||||
map(parser.parseSubExpression(11), (right) => ({
|
||||
map(parser.parseSubExpression(21), (right) => ({
|
||||
value: Math.floor(left / right),
|
||||
})),
|
||||
},
|
||||
|
@ -94,7 +94,7 @@ const Operators: TokenHandler[] = [
|
|||
leftBindingPower: 20,
|
||||
token: DIV_TOKEN,
|
||||
parse: ({ value: left }, matched, parser) =>
|
||||
map(parser.parseSubExpression(11), (right) => ({ value: left / right })),
|
||||
map(parser.parseSubExpression(21), (right) => ({ value: left / right })),
|
||||
},
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue