diff --git a/src/ui/templater/ast.js b/src/ui/templater/ast.js index 90ba16c6d..e938f9f66 100644 --- a/src/ui/templater/ast.js +++ b/src/ui/templater/ast.js @@ -11,8 +11,8 @@ const operatorPrecedences = [ '*', '/', '%', - '+', '-', + '+', '<<', '>>', '&', diff --git a/test/templater/ast.spec.js b/test/templater/ast.spec.js index 9cdf62bff..c9e8f5c41 100644 --- a/test/templater/ast.spec.js +++ b/test/templater/ast.spec.js @@ -9,8 +9,9 @@ import { List } from '../../src/ui/templater/list'; describe('templater ast parser', () => { it('should parse various expressions', () => { [ - ['2-5 + qwe', '(2 - (5 + qwe))'], - ['2 * 8 + 1 - 4 *4 ', '(((2 * 8) + 1) - (4 * 4))'], + ['2 - 5 - k + x * w', '(((2 - 5) - k) + (x * w))'], + ['2-5 + qwe', '((2 - 5) + qwe)'], + ['2 * 8 + 1 - 4 *4 ', '((2 * 8) + (1 - (4 * 4)))'], ['1 + (x - 4) * 3', '(1 + ((x - 4) * 3))'], ['x < 5', '(x < 5)'], ['x + 1 < 5 - y', '((x + 1) < (5 - y))'],