Author: fperrad
Date: Mon Mar 20 06:49:38 2006
New Revision: 11949
Modified:
trunk/languages/lua/lib/luastring.pir
trunk/languages/lua/lib/luatable.pir
trunk/languages/lua/t/pmc/function.t
Log:
Lua :
- use HLL support for Sub
Modified: trunk/languages/lua/lib/luastring.pir
==============================================================================
--- trunk/languages/lua/lib/luastring.pir (original)
+++ trunk/languages/lua/lib/luastring.pir Mon Mar 20 06:49:38 2006
@@ -242,7 +242,7 @@
.sub _string_dump :anon
.param pmc function :optional
- checktype(function, "Sub")
+ checktype(function, "function")
not_implemented()
.end
Modified: trunk/languages/lua/lib/luatable.pir
==============================================================================
--- trunk/languages/lua/lib/luatable.pir (original)
+++ trunk/languages/lua/lib/luatable.pir Mon Mar 20 06:49:38 2006
@@ -160,7 +160,7 @@
.local pmc value
.local pmc ret
checktype(table, "table")
- checktype(f, "Sub")
+ checktype(f, "function")
new idx, .LuaNil
L1:
(idx, value) = next(table, idx)
@@ -195,7 +195,7 @@
.local int i
.local int n
checktype(table, "table")
- checktype(f, "Sub")
+ checktype(f, "function")
n = getn(table)
i = 0
new index, .LuaNumber
@@ -391,7 +391,7 @@
n = getn(table)
if_null comp, L1
if comp goto L1
- checktype(comp, "Sub")
+ checktype(comp, "function")
goto L2
L1:
.const .Sub lessthan = "lessthan"
Modified: trunk/languages/lua/t/pmc/function.t
==============================================================================
--- trunk/languages/lua/t/pmc/function.t (original)
+++ trunk/languages/lua/t/pmc/function.t Mon Mar 20 06:49:38 2006
@@ -159,22 +159,15 @@
boolean
OUTPUT
-TODO: {
-local $TODO = "not implemented.";
-
pir_output_is(<< 'CODE', << 'OUTPUT', "check HLL");
.HLL "Lua", "lua_group"
.sub _main
- .local pmc pmc1
# .const .LuaFunction F1 = "f1"
- .const .Sub F1 = "f1"
- pmc1 = F1
+ .const .Sub pmc1 = "f1"
.local int bool1
bool1 = isa pmc1, "LuaFunction"
print bool1
print "\n"
- print pmc1
- print "\n"
pmc1()
end
.end
@@ -184,6 +177,7 @@
.end
CODE
1
+f1()
OUTPUT
pir_output_is(<< 'CODE', << 'OUTPUT', "check HLL (autoboxing)");
@@ -204,8 +198,6 @@
1
OUTPUT
-}
-
pir_output_like(<< 'CODE', << 'OUTPUT', "check tostring");
.HLL "Lua", "lua_group"
.sub _main