summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-17 16:25:55 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-17 16:25:55 +0100
commitf8c5db56362d538f035299932c3cc9ff1a3c6904 (patch)
tree8568544b8ce450ded6274c3b7a6eed367dfe6073
parent6423be495b1d6ca90ffaf2b9aab9913885504c15 (diff)
downloadlace-f8c5db56362d538f035299932c3cc9ff1a3c6904.tar.gz
{BUILTIN,COMPILER}: Ensure internal errors are not normalised purely to strings
-rw-r--r--lib/lace/builtin.lua2
-rw-r--r--lib/lace/compiler.lua4
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)