summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtx-context.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-09 20:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-09 20:15:05 +0100
commitdc98ffdc842271d05903846b460fab90d4d83739 (patch)
tree49603cd805408ebdde3a7eafc59c40279dc7e9ad /scripts/context/lua/mtx-context.lua
parent08128a9710f7a34e16f7487b3bccfe7feadb36f1 (diff)
downloadcontext-dc98ffdc842271d05903846b460fab90d4d83739.tar.gz
2015-03-09 19:29:00
Diffstat (limited to 'scripts/context/lua/mtx-context.lua')
-rw-r--r--scripts/context/lua/mtx-context.lua22
1 files changed, 19 insertions, 3 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index 8a18cab39..ac93145be 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -644,6 +644,22 @@ function scripts.context.run(ctxdata,filename)
scripts.context.make(formatname,a_engine)
formatfile, scriptfile = resolvers.locateformat(formatname)
end
+ --
+ local function combine(key)
+ local flag = validstring(environment[key])
+ local plus = analysis[key]
+ if flag and plus then
+ return plus .. "," .. flag -- flag wins
+ else
+ return flag or plus -- flag wins
+ end
+ end
+ local a_trackers = analysis.trackers
+ local a_experiments = analysis.experiments
+ local directives = combine("directives")
+ local trackers = combine("trackers")
+ local experiments = combine("experiments")
+ --
if formatfile and scriptfile then
local suffix = validstring(getargument("suffix"))
local resultname = validstring(getargument("result"))
@@ -691,9 +707,9 @@ function scripts.context.run(ctxdata,filename)
local maxnofruns = once and 1 or multipass_nofruns
--
local c_flags = {
- directives = validstring(environment.directives), -- gets passed via mtxrun
- trackers = validstring(environment.trackers), -- gets passed via mtxrun
- experiments = validstring(environment.experiments), -- gets passed via mtxrun
+ directives = directives, -- gets passed via mtxrun
+ trackers = trackers, -- gets passed via mtxrun
+ experiments = experiments, -- gets passed via mtxrun
--
result = validstring(resultname),
input = validstring(getargument("input") or filename), -- alternative input