From bd7eedda590fc370d54e43945da0a5aae820d907 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Wed, 5 May 2010 14:36:56 +0200 Subject: [PATCH] OS becomes a dynpmc, so load it --- lua/lib/luaaux.pir | 1 + lua/lib/luaos.pir | 1 + lua/lib/luaperl.pir | 1 + t/env.t | 1 + t/lexico.t | 1 + t/luad.t | 1 + t/test_lex.t | 1 + 7 files changed, 7 insertions(+) diff --git a/lua/lib/luaaux.pir b/lua/lib/luaaux.pir index 680c40d..fc471f8 100644 --- a/lua/lib/luaaux.pir +++ b/lua/lib/luaaux.pir @@ -693,6 +693,7 @@ This function only loads the chunk; it does not run it. pbcname .= '.pbc' $I0 = stat pbcname, .STAT_EXISTS unless $I0 goto L3 + $P0 = loadlib 'os' new $P0, 'OS' $S0 = $P0.'cwd'() $S0 .= '/' diff --git a/lua/lib/luaos.pir b/lua/lib/luaos.pir index a49e2c7..7f9b9e9 100644 --- a/lua/lib/luaos.pir +++ b/lua/lib/luaos.pir @@ -22,6 +22,7 @@ L. .sub 'luaopen_os' # print "init Lua OS\n" + $P0 = loadlib 'os' .local pmc _lua__GLOBAL _lua__GLOBAL = get_hll_global '_G' diff --git a/lua/lib/luaperl.pir b/lua/lib/luaperl.pir index 3da8b10..1ab2fc4 100644 --- a/lua/lib/luaperl.pir +++ b/lua/lib/luaperl.pir @@ -30,6 +30,7 @@ It's a temporary work. Waiting for the real PIR compiler/interpreter. .namespace [] .sub '__onload' :anon :load + $P0 = loadlib 'os' $P0 = newclass [ 'Lua'; 'PerlCompiler' ] new $P1, $P0 compreg 'lua', $P1 diff --git a/t/env.t b/t/env.t index 50407d9..d9aca35 100755 --- a/t/env.t +++ b/t/env.t @@ -13,6 +13,7 @@ =cut .sub 'main' :main + $P0 = loadlib 'os' .include 'test_more.pir' $P0 = new 'FileHandle' diff --git a/t/lexico.t b/t/lexico.t index 9508b16..a0f732c 100755 --- a/t/lexico.t +++ b/t/lexico.t @@ -16,6 +16,7 @@ L. =cut .sub 'main' :main + $P0 = loadlib 'os' .include 'test_more.pir' plan(3) diff --git a/t/luad.t b/t/luad.t index 5122a58..3b8757e 100755 --- a/t/luad.t +++ b/t/luad.t @@ -19,6 +19,7 @@ by Kein-Hong Man =cut .sub 'main' :main + $P0 = loadlib 'os' .include 'test_more.pir' $P0 = open 'luac -v', 'rp' diff --git a/t/test_lex.t b/t/test_lex.t index 3a9cc4a..dc74155 100755 --- a/t/test_lex.t +++ b/t/test_lex.t @@ -19,6 +19,7 @@ L. =cut .sub 'main' :main + $P0 = loadlib 'os' .include 'test_more.pir' plan(23)