From f8c5db56362d538f035299932c3cc9ff1a3c6904 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 17 Jul 2012 16:25:55 +0100 Subject: {BUILTIN,COMPILER}: Ensure internal errors are not normalised purely to strings --- lib/lace/builtin.lua | 2 +- lib/lace/compiler.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lace/builtin.lua b/lib/lace/builtin.lua index d911eb2..9d7a735 100644 --- a/lib/lace/builtin.lua +++ b/lib/lace/builtin.lua @@ -246,7 +246,7 @@ function builtin.include(comp_context, cmd, file, ...) -- Okay, the file is present, let's parse it. local ruleset, msg = compiler().internal_compile(comp_context, real, content, true) if type(ruleset) ~= "table" then - return compiler().error(msg) + return false, type(msg) == "table" and msg or compiler().error(msg) end -- Okay, we parsed, so build the runtime diff --git a/lib/lace/compiler.lua b/lib/lace/compiler.lua index 5d43547..d3a393d 100644 --- a/lib/lace/compiler.lua +++ b/lib/lace/compiler.lua @@ -43,8 +43,8 @@ local function _command(ctx, name) end local function _normalise_error(ctx, err) - -- For now, just return the string - return err.msg + -- For now, just return the error + return err end local function _setposition(context, ruleset, linenr) -- cgit v1.2.1