From 88c1052e700f38cf3d8ad82d469da4c487760b7e Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 29 May 2020 02:00:20 +0800 Subject: change operator precedence to [1].^ [2].unary operators (not, #, -, ~) [3].|> [4].*, /, //, %, ... fix destructure with one table variable to operator-value expression. fix simple chain value with Lua keyword colon chain item. --- spec/inputs/backcall.moon | 2 +- spec/inputs/destructure.moon | 3 +++ spec/inputs/plus.moon | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/inputs/backcall.moon b/spec/inputs/backcall.moon index 5f53f9e..b6fe24f 100644 --- a/spec/inputs/backcall.moon +++ b/spec/inputs/backcall.moon @@ -107,7 +107,7 @@ alert "hi" x = 123 |> a |> b or 456 |> c |> d or a.if\then("abc") or a?.b\c?(123) or x\y -y = 1 + # 2 |> a ^ c |> b(3,_) ^ 4 * -123 |> f |> f1 or 123 +y = 1 + not # 2 |> (a ^ c) |> b(3,_) * 4 ^ -123 |> f |> f1 or 123 nil diff --git a/spec/inputs/destructure.moon b/spec/inputs/destructure.moon index d61b6ae..49e6393 100644 --- a/spec/inputs/destructure.moon +++ b/spec/inputs/destructure.moon @@ -112,3 +112,6 @@ do }] {:one, :two, :three} = {w,true for w in foo\gmatch("%S+")} + + {:a},b = a\if(123) + t, 123 + diff --git a/spec/inputs/plus.moon b/spec/inputs/plus.moon index 38d3a08..ca03499 100644 --- a/spec/inputs/plus.moon +++ b/spec/inputs/plus.moon @@ -1,3 +1,4 @@ +x\do "work" func a\do!\end("OK")\if "abc",123 -- cgit v1.2.3-55-g6feb