diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-09-09 23:45:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-09-09 23:45:00 +0200 |
commit | cf3f5ed936ab0e84942af2e69862db6941c58d0f (patch) | |
tree | 195b942015faff3d0c03d0d1627185320e002548 /scripts | |
parent | 536e4dd4fe2e98c3cefdb9741507c20f4489e2c0 (diff) | |
download | context-cf3f5ed936ab0e84942af2e69862db6941c58d0f.tar.gz |
beta 2010.09.09 23:45
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-base.lua | 2 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 20 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 20 | ||||
-rwxr-xr-x | scripts/context/stubs/unix/mtxrun | 20 |
4 files changed, 40 insertions, 22 deletions
diff --git a/scripts/context/lua/mtx-base.lua b/scripts/context/lua/mtx-base.lua index 443f653f0..67bde5b79 100644 --- a/scripts/context/lua/mtx-base.lua +++ b/scripts/context/lua/mtx-base.lua @@ -130,7 +130,7 @@ elseif environment.arguments["configurations"] or environment.arguments["show-co resolvers.listers.configurations() elseif environment.arguments["help"] or (environment.files[1]=='help') or (#environment.files==0) then logs.help(messages.help) -elseif environment.files[1]=='texmfcnf.lua' then +elseif environment.files[1] == 'texmfcnf.lua' then resolvers.load("nofiles") resolvers.listers.configurations() else diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index f792cd942..246d08103 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -709,20 +709,22 @@ function table.imerged(...) return tmp end -local function fastcopy(old) -- fast one +local function fastcopy(old,metatabletoo) -- fast one if old then local new = { } for k,v in next, old do if type(v) == "table" then - new[k] = fastcopy(v) -- was just table.copy + new[k] = fastcopy(v,metatabletoo) -- was just table.copy else new[k] = v end end - -- optional second arg - local mt = getmetatable(old) - if mt then - setmetatable(new,mt) + if metatabletoo then + -- optional second arg + local mt = getmetatable(old) + if mt then + setmetatable(new,mt) + end end return new else @@ -730,6 +732,8 @@ local function fastcopy(old) -- fast one end end +-- todo : copy without metatable + local function copy(t, tables) -- taken from lua wiki, slightly adapted tables = tables or { } local tcopy = {} @@ -1146,6 +1150,7 @@ function table.tofile(filename,root,name,reduce,noquotes,hexify) serialize(root,name,flush,reduce,noquotes,hexify) end f:close() + io.flush() end end @@ -1381,6 +1386,7 @@ function io.savedata(filename,data,joiner) f:write(data or "") end f:close() + io.flush() return true else return false @@ -9406,7 +9412,7 @@ function resolvers.variableofformat(str) return formats[str] or formats[alternatives[str]] or '' end -function resolvers.vsriableofformatorsuffix(str) +function resolvers.variableofformatorsuffix(str) local v = formats[str] if v then return v diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index f792cd942..246d08103 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -709,20 +709,22 @@ function table.imerged(...) return tmp end -local function fastcopy(old) -- fast one +local function fastcopy(old,metatabletoo) -- fast one if old then local new = { } for k,v in next, old do if type(v) == "table" then - new[k] = fastcopy(v) -- was just table.copy + new[k] = fastcopy(v,metatabletoo) -- was just table.copy else new[k] = v end end - -- optional second arg - local mt = getmetatable(old) - if mt then - setmetatable(new,mt) + if metatabletoo then + -- optional second arg + local mt = getmetatable(old) + if mt then + setmetatable(new,mt) + end end return new else @@ -730,6 +732,8 @@ local function fastcopy(old) -- fast one end end +-- todo : copy without metatable + local function copy(t, tables) -- taken from lua wiki, slightly adapted tables = tables or { } local tcopy = {} @@ -1146,6 +1150,7 @@ function table.tofile(filename,root,name,reduce,noquotes,hexify) serialize(root,name,flush,reduce,noquotes,hexify) end f:close() + io.flush() end end @@ -1381,6 +1386,7 @@ function io.savedata(filename,data,joiner) f:write(data or "") end f:close() + io.flush() return true else return false @@ -9406,7 +9412,7 @@ function resolvers.variableofformat(str) return formats[str] or formats[alternatives[str]] or '' end -function resolvers.vsriableofformatorsuffix(str) +function resolvers.variableofformatorsuffix(str) local v = formats[str] if v then return v diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index f792cd942..246d08103 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -709,20 +709,22 @@ function table.imerged(...) return tmp end -local function fastcopy(old) -- fast one +local function fastcopy(old,metatabletoo) -- fast one if old then local new = { } for k,v in next, old do if type(v) == "table" then - new[k] = fastcopy(v) -- was just table.copy + new[k] = fastcopy(v,metatabletoo) -- was just table.copy else new[k] = v end end - -- optional second arg - local mt = getmetatable(old) - if mt then - setmetatable(new,mt) + if metatabletoo then + -- optional second arg + local mt = getmetatable(old) + if mt then + setmetatable(new,mt) + end end return new else @@ -730,6 +732,8 @@ local function fastcopy(old) -- fast one end end +-- todo : copy without metatable + local function copy(t, tables) -- taken from lua wiki, slightly adapted tables = tables or { } local tcopy = {} @@ -1146,6 +1150,7 @@ function table.tofile(filename,root,name,reduce,noquotes,hexify) serialize(root,name,flush,reduce,noquotes,hexify) end f:close() + io.flush() end end @@ -1381,6 +1386,7 @@ function io.savedata(filename,data,joiner) f:write(data or "") end f:close() + io.flush() return true else return false @@ -9406,7 +9412,7 @@ function resolvers.variableofformat(str) return formats[str] or formats[alternatives[str]] or '' end -function resolvers.vsriableofformatorsuffix(str) +function resolvers.variableofformatorsuffix(str) local v = formats[str] if v then return v |