summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-08-05 12:20:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-08-05 12:20:00 +0200
commit6a79194dfe7625cbb5849ddabdda19a08ed039ff (patch)
tree26ef095c1cdf5db939b972f213ec67fcc3eb7bf0 /scripts
parent3e22d20de49d2e67302953c3d1018a1ceba4c417 (diff)
downloadcontext-6a79194dfe7625cbb5849ddabdda19a08ed039ff.tar.gz
beta 2012.08.05 12:20
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtxrun.lua6
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua6
-rwxr-xr-xscripts/context/stubs/unix/mtxrun6
3 files changed, 15 insertions, 3 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index b4df0521b..413fc9f32 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -2159,7 +2159,7 @@ if not modules then modules = { } end modules ['l-number'] = {
-- this module will be replaced when we have the bit library
-local tostring = tostring
+local tostring, tonumber = tostring, tonumber
local format, floor, match, rep = string.format, math.floor, string.match, string.rep
local concat, insert = table.concat, table.insert
local lpegmatch = lpeg.match
@@ -2260,6 +2260,10 @@ function number.tobitstring(n,m)
end
+function number.valid(str,default)
+ return tonumber(str) or default or nil
+end
+
end -- of closure
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index b4df0521b..413fc9f32 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -2159,7 +2159,7 @@ if not modules then modules = { } end modules ['l-number'] = {
-- this module will be replaced when we have the bit library
-local tostring = tostring
+local tostring, tonumber = tostring, tonumber
local format, floor, match, rep = string.format, math.floor, string.match, string.rep
local concat, insert = table.concat, table.insert
local lpegmatch = lpeg.match
@@ -2260,6 +2260,10 @@ function number.tobitstring(n,m)
end
+function number.valid(str,default)
+ return tonumber(str) or default or nil
+end
+
end -- of closure
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index b4df0521b..413fc9f32 100755
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -2159,7 +2159,7 @@ if not modules then modules = { } end modules ['l-number'] = {
-- this module will be replaced when we have the bit library
-local tostring = tostring
+local tostring, tonumber = tostring, tonumber
local format, floor, match, rep = string.format, math.floor, string.match, string.rep
local concat, insert = table.concat, table.insert
local lpegmatch = lpeg.match
@@ -2260,6 +2260,10 @@ function number.tobitstring(n,m)
end
+function number.valid(str,default)
+ return tonumber(str) or default or nil
+end
+
end -- of closure