aboutsummaryrefslogtreecommitdiff
path: root/testes/coroutine.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-27 13:59:39 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-27 13:59:39 -0300
commitdf13f259487459f3a28d31d76c890aa6c2d061e0 (patch)
treef354a0746530369d4dd70113c9752d019fbd200b /testes/coroutine.lua
parent643188d6e58dfd3270d689230867289347260b74 (diff)
downloadlua-df13f259487459f3a28d31d76c890aa6c2d061e0.tar.gz
lua-df13f259487459f3a28d31d76c890aa6c2d061e0.tar.bz2
lua-df13f259487459f3a28d31d76c890aa6c2d061e0.zip
First version of OP_MMBIN opcodes
In arithmetic/bitwise operators, the call to metamethods is made in a separate opcode following the main one. (The main opcode skips this next one when the operation succeeds.) This change reduces slightly the size of the binary and the complexity of the arithmetic/bitwise opcodes. It also simplfies the treatment of errors and yeld/resume in these operations, as there are much fewer cases to consider. (Only OP_MMBIN/OP_MMBINI/OP_MMBINK, instead of all variants of all arithmetic/bitwise operators.)
Diffstat (limited to 'testes/coroutine.lua')
-rw-r--r--testes/coroutine.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua
index 48f4c5bf..81d848a3 100644
--- a/testes/coroutine.lua
+++ b/testes/coroutine.lua
@@ -751,7 +751,7 @@ assert(run(function () return a >> 2 end, {"shr"}) == 10 >> 2)
751assert(run(function () return 1 >> a end, {"shr"}) == 1 >> 10) 751assert(run(function () return 1 >> a end, {"shr"}) == 1 >> 10)
752assert(run(function () return a << 2 end, {"shl"}) == 10 << 2) 752assert(run(function () return a << 2 end, {"shl"}) == 10 << 2)
753assert(run(function () return 1 << a end, {"shl"}) == 1 << 10) 753assert(run(function () return 1 << a end, {"shl"}) == 1 << 10)
754assert(run(function () return a ~ 2 end, {"bxor"}) == 10 ~ 2) 754assert(run(function () return 2 ~ a end, {"bxor"}) == 2 ~ 10)
755 755
756 756
757assert(run(function () return a..b end, {"concat"}) == "1012") 757assert(run(function () return a..b end, {"concat"}) == "1012")