diff options
author | Li Jin <dragon-fly@qq.com> | 2020-05-29 02:00:20 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2020-05-29 02:00:20 +0800 |
commit | 88c1052e700f38cf3d8ad82d469da4c487760b7e (patch) | |
tree | aaa19c10ea1f9653e249b529586a688c275563ca /spec | |
parent | 04e3cd43cee426cd5c2fa1d0fab5fabc7f19c039 (diff) | |
download | yuescript-88c1052e700f38cf3d8ad82d469da4c487760b7e.tar.gz yuescript-88c1052e700f38cf3d8ad82d469da4c487760b7e.tar.bz2 yuescript-88c1052e700f38cf3d8ad82d469da4c487760b7e.zip |
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.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/backcall.moon | 2 | ||||
-rw-r--r-- | spec/inputs/destructure.moon | 3 | ||||
-rw-r--r-- | spec/inputs/plus.moon | 1 |
3 files changed, 5 insertions, 1 deletions
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" | |||
107 | 107 | ||
108 | x = 123 |> a |> b or 456 |> c |> d or a.if\then("abc") or a?.b\c?(123) or x\y | 108 | x = 123 |> a |> b or 456 |> c |> d or a.if\then("abc") or a?.b\c?(123) or x\y |
109 | 109 | ||
110 | y = 1 + # 2 |> a ^ c |> b(3,_) ^ 4 * -123 |> f |> f1 or 123 | 110 | y = 1 + not # 2 |> (a ^ c) |> b(3,_) * 4 ^ -123 |> f |> f1 or 123 |
111 | 111 | ||
112 | nil | 112 | nil |
113 | 113 | ||
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 | |||
112 | }] | 112 | }] |
113 | 113 | ||
114 | {:one, :two, :three} = {w,true for w in foo\gmatch("%S+")} | 114 | {:one, :two, :three} = {w,true for w in foo\gmatch("%S+")} |
115 | |||
116 | {:a},b = a\if(123) + t, 123 | ||
117 | |||
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 @@ | |||
1 | x\do "work" | ||
1 | 2 | ||
2 | func a\do!\end("OK")\if "abc",123 | 3 | func a\do!\end("OK")\if "abc",123 |
3 | 4 | ||