1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-05-05 19:03:27 -07:00

lips is lips

This commit is contained in:
Connor Olding 2016-01-13 09:51:29 -08:00
parent 9fd46b571f
commit 5e12951010

View File

@ -1,6 +1,4 @@
-- split lips.lua
local assembler = {
local lips = {
_DESCRIPTION = 'Assembles MIPS assembly files for the R4300i CPU.',
_URL = 'https://github.com/notwa/lips/',
_LICENSE = [[
@ -26,7 +24,7 @@ local function readfile(fn)
return asm
end
function assembler.word_writer()
function lips.word_writer()
local buff = {}
local max = -1
return function(pos, b)
@ -47,13 +45,13 @@ function assembler.word_writer()
end
end
function assembler.assemble(fn_or_asm, writer, options)
function lips.assemble(fn_or_asm, writer, options)
-- assemble MIPS R4300i assembly code.
-- if fn_or_asm contains a newline; treat as assembly, otherwise load file.
-- returns error message on error, or nil on success.
fn_or_asm = tostring(fn_or_asm)
local default_writer = not writer
writer = writer or assembler.word_writer()
writer = writer or lips.word_writer()
options = options or {}
local function main()
@ -83,7 +81,7 @@ function assembler.assemble(fn_or_asm, writer, options)
end
end
return setmetatable(assembler, {
return setmetatable(lips, {
__call = function(self, ...)
return self.assemble(...)
end,