From 5aa0b5abe117df0b8f9ded3770686f72fb467534 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 24 Nov 2015 17:06:38 -0800 Subject: [PATCH] added 'unsafe' option to not wrap execution in pcall --- lips.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lips.lua b/lips.lua index e1e0b3e..6aeda5b 100644 --- a/lips.lua +++ b/lips.lua @@ -1308,7 +1308,7 @@ function Dumper:dump() end end -local function assemble(fn_or_asm, writer) +local function 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. @@ -1334,8 +1334,12 @@ local function assemble(fn_or_asm, writer) return parser:parse(asm) end - local ok, err = pcall(main) - return err + if options.unsafe then + return main() + else + local ok, err = pcall(main) + return err + end end return setmetatable(assembler, {