diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-23 12:23:45 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-23 12:23:45 -0200 |
commit | 84e32ad2ebd6bd160c1320456743a5b1d8f233e9 (patch) | |
tree | c5a32eaf7577c99e7598e9de1385a6b53522f04b /testes/events.lua | |
parent | 35296e1fde705b3ac8356a4f4ce426497cf7b64c (diff) | |
download | lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.tar.gz lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.tar.bz2 lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.zip |
Added opcodes for arithmetic with K operands
Added opcodes for all seven arithmetic operators with K operands
(that is, operands that are numbers in the array of constants of
the function). They cover the cases of constant float operands
(e.g., 'x + .0.0', 'x^0.5') and large integer operands (e.g.,
'x % 10000').
Diffstat (limited to 'testes/events.lua')
-rw-r--r-- | testes/events.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/testes/events.lua b/testes/events.lua index b071c2a3..ac630d89 100644 --- a/testes/events.lua +++ b/testes/events.lua | |||
@@ -144,6 +144,8 @@ t.__bnot = f("bnot") | |||
144 | -- when the constant table is very small. | 144 | -- when the constant table is very small. |
145 | assert(b+5 == b) | 145 | assert(b+5 == b) |
146 | assert(cap[0] == "add" and cap[1] == b and cap[2] == 5 and cap[3]==undef) | 146 | assert(cap[0] == "add" and cap[1] == b and cap[2] == 5 and cap[3]==undef) |
147 | assert(5.2 + b == 5.2) | ||
148 | assert(cap[0] == "add" and cap[1] == 5.2 and cap[2] == b and cap[3]==undef) | ||
147 | assert(b+'5' == b) | 149 | assert(b+'5' == b) |
148 | assert(cap[0] == "add" and cap[1] == b and cap[2] == '5' and cap[3]==undef) | 150 | assert(cap[0] == "add" and cap[1] == b and cap[2] == '5' and cap[3]==undef) |
149 | assert(5+b == 5) | 151 | assert(5+b == 5) |