diff options
author | Hans Hagen <pragma@wxs.nl> | 2012-10-02 15:13:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2012-10-02 15:13:00 +0200 |
commit | df4e78545a9a7e02cca523a2912aa1684f6867c6 (patch) | |
tree | 64e04d98a35819e768b8277c5e0e0c1adcafc234 /tex/generic | |
parent | 55ce9de27314a53bb5583cf482a2c4c64e3d1f76 (diff) | |
download | context-df4e78545a9a7e02cca523a2912aa1684f6867c6.tar.gz |
beta 2012.10.02 15:13
Diffstat (limited to 'tex/generic')
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 9862853db..844ff18cf 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 09/25/12 21:44:34 +-- merge date : 10/02/12 15:13:09 do -- begin closure to overcome local limits and interference @@ -2033,30 +2033,49 @@ function boolean.tonumber(b) end function toboolean(str,tolerant) - if str == true or str == false then - return str - elseif tolerant then - local tstr = type(str) - if tstr == "string" then - return str == "true" or str == "yes" or str == "on" or str == "1" or str == "t" - elseif tstr == "number" then - return tonumber(str) ~= 0 - elseif tstr == "nil" then - return false - else - return str - end + if str == nil then + return false + elseif str == false then + return false + elseif str == true then + return true elseif str == "true" then return true elseif str == "false" then return false + elseif not tolerant then + return false + elseif str == 0 then + return false + elseif (tonumber(str) or 0) > 0 then + return true else - return str + return str == "yes" or str == "on" or str == "t" end end string.toboolean = toboolean +function string.booleanstring(str) + if str == nil then + return false + elseif str == false then + return false + elseif str == true then + return true + elseif str == "true" then + return true + elseif str == "false" then + return false + elseif str == 0 then + return false + elseif (tonumber(str) or 0) > 0 then + return true + else + return str == "yes" or str == "on" or str == "t" + end +end + function string.is_boolean(str,default) if type(str) == "string" then if str == "true" or str == "yes" or str == "on" or str == "t" then |