summaryrefslogtreecommitdiff
path: root/tex/context/base/luat-env.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-06-05 10:40:16 +0300
committerMarius <mariausol@gmail.com>2012-06-05 10:40:16 +0300
commit0d22bc1c0589c61e35cf9746a8d4d0c4ac2ea8da (patch)
tree2ec0f7f663e45fd3c4539dfb54eb6e640d472bd6 /tex/context/base/luat-env.lua
parentad5540007a2ac6504a47289ace109a76ec759a7e (diff)
downloadcontext-0d22bc1c0589c61e35cf9746a8d4d0c4ac2ea8da.tar.gz
beta 2012.06.05 09:16
Diffstat (limited to 'tex/context/base/luat-env.lua')
-rw-r--r--tex/context/base/luat-env.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/tex/context/base/luat-env.lua b/tex/context/base/luat-env.lua
index 4f1b661c2..840b2344f 100644
--- a/tex/context/base/luat-env.lua
+++ b/tex/context/base/luat-env.lua
@@ -79,6 +79,8 @@ local mt = {
setmetatable(environment,mt)
+-- context specific arguments (in order not to confuse the engine)
+
function environment.initializearguments(arg)
local arguments, files = { }, { }
environment.arguments, environment.files, environment.sortedflags = arguments, files, nil
@@ -87,10 +89,12 @@ function environment.initializearguments(arg)
if index > 0 then
local flag, value = match(argument,"^%-+(.-)=(.-)$")
if flag then
+ flag = gsub(flag,"^c:","")
arguments[flag] = unquoted(value or "")
else
flag = match(argument,"^%-+(.+)")
if flag then
+ flag = gsub(flag,"^c:","")
arguments[flag] = true
else
files[#files+1] = argument
@@ -110,7 +114,7 @@ end
-- tricky: too many hits when we support partials unless we add
-- a registration of arguments so from now on we have 'partial'
-function environment.argument(name,partial)
+function environment.getargument(name,partial)
local arguments, sortedflags = environment.arguments, environment.sortedflags
if arguments[name] then
return arguments[name]
@@ -133,6 +137,8 @@ function environment.argument(name,partial)
return nil
end
+environment.argument = environment.getargument
+
function environment.splitarguments(separator) -- rather special, cut-off before separator
local done, before, after = false, { }, { }
local originalarguments = environment.originalarguments