From 9621add2918cc4943e6693b74ae85d51dd264fcf Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 21 Apr 2014 20:59:39 +1000 Subject: We don't need the testlua directory any more. --- LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/luac.lua | 71 ------------------------ 1 file changed, 71 deletions(-) delete mode 100644 LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/luac.lua (limited to 'LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/luac.lua') diff --git a/LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/luac.lua b/LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/luac.lua deleted file mode 100644 index 80cc4a5..0000000 --- a/LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/luac.lua +++ /dev/null @@ -1,71 +0,0 @@ ---[[-------------------------------------------------------------------- - - luac.lua - Primitive luac in Lua - This file is part of Yueliang. - - Copyright (c) 2005 Kein-Hong Man - The COPYRIGHT file describes the conditions - under which this software may be distributed. - - See the ChangeLog for more information. - -----------------------------------------------------------------------]] - ---[[-------------------------------------------------------------------- --- Notes: --- * based on luac.lua in the test directory of the 5.0.3 distribution --- * usage: lua luac.lua file.lua -----------------------------------------------------------------------]] - ------------------------------------------------------------------------- --- load and initialize the required modules ------------------------------------------------------------------------- -require("lzio.lua") -require("llex.lua") -require("lopcodes.lua") -require("ldump.lua") -require("lcode.lua") -require("lparser.lua") - -luaX:init() -- required by llex -local LuaState = {} -- dummy, not actually used, but retained since - -- the intention is to complete a straight port - ------------------------------------------------------------------------- --- interfacing to yueliang ------------------------------------------------------------------------- - --- currently asserts are enabled because the codebase hasn't been tested --- much (if you don't want asserts, just comment them out) -function lua_assert(test) - if not test then error("assertion failed!") end -end - -function yloadfile(filename) - -- luaZ:make_getF returns a file chunk reader - -- luaZ:init returns a zio input stream - local zio = luaZ:init(luaZ:make_getF(filename), nil, "@"..filename) - if not zio then return end - -- luaY:parser parses the input stream - -- func is the function prototype in tabular form; in C, func can - -- now be used directly by the VM, this can't be done in Lua - local func = luaY:parser(LuaState, zio, nil) - -- luaU:make_setS returns a string chunk writer - local writer, buff = luaU:make_setS() - -- luaU:dump builds a binary chunk - luaU:dump(LuaState, func, writer, buff) - -- a string.dump equivalent in returned - return buff.data -end - ------------------------------------------------------------------------- --- command line interface ------------------------------------------------------------------------- - -assert(arg[1] ~= nil and arg[2] == nil, "usage: lua luac.lua file.lua") -local f = assert(io.open("luac.out","wb")) -f:write(assert(yloadfile(arg[1]))) -io.close(f) - ---end -- cgit v1.1