diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-11-27 16:45:58 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2015-11-27 17:46:52 +0000 |
commit | eec290966a9d8797f50e08640b83f8d07b199bae (patch) | |
tree | adf85caadddd455944daf5d47b23c68068e4ba74 | |
parent | 8b26228473c7910d5899c31a0db9920a9184db4d (diff) | |
download | lace-eec290966a9d8797f50e08640b83f8d07b199bae.tar.gz |
lace.compiler.transfer_args: call errors `msg`
This avoids shadowing the error module,
so its methods can be used.
-rw-r--r-- | lib/lace/compiler.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lace/compiler.lua b/lib/lace/compiler.lua index 7b3c504..ec680e6 100644 --- a/lib/lace/compiler.lua +++ b/lib/lace/compiler.lua @@ -62,7 +62,7 @@ local function _setposition(context, ruleset, linenr) end local function transfer_args(compcontext, content, rules) - local args, err = {} + local args = {} for i = 1, #content do if content[i].sub then local sub = content[i].sub @@ -75,12 +75,12 @@ local function transfer_args(compcontext, content, rules) if type(rules) ~= "table" then return rules, subargs end - local definerule, err = definefn(compcontext, "define", definename, + local definerule, msg = definefn(compcontext, "define", definename, unpack(subargs)) if type(definerule) ~= "table" then -- for now, we lock the error to the whole sublex - err.words = {i} - return definerule, err + msg.words = {i} + return definerule, msg end args[#args+1] = definename rules[#rules+1] = definerule |