summaryrefslogtreecommitdiff
path: root/tex/context/base/l-number.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-12-29 22:32:00 +0100
committerHans Hagen <pragma@wxs.nl>2009-12-29 22:32:00 +0100
commit5eb872dbc6bbc35e222d5b23fc783fb0e75d4a99 (patch)
tree91164a948df7bcf12b5423db3ef1b310ca2b5017 /tex/context/base/l-number.lua
parent326b0613f1ed21f5711a8d94403512171c058e48 (diff)
downloadcontext-5eb872dbc6bbc35e222d5b23fc783fb0e75d4a99.tar.gz
beta 2009.12.29 22:32
Diffstat (limited to 'tex/context/base/l-number.lua')
-rw-r--r--tex/context/base/l-number.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/tex/context/base/l-number.lua b/tex/context/base/l-number.lua
index 39ca2c6b6..a1249f055 100644
--- a/tex/context/base/l-number.lua
+++ b/tex/context/base/l-number.lua
@@ -6,14 +6,16 @@ if not modules then modules = { } end modules ['l-number'] = {
license = "see context related readme files"
}
-local format, foor, insert = string.format, math.floor, table.insert
+local tostring = tostring
+local format, floor, insert, match = string.format, math.floor, table.insert, string.match
+local lpegmatch = lpeg.match
number = number or { }
-- a,b,c,d,e,f = number.toset(100101)
function number.toset(n)
- return (tostring(n)):match("(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)")
+ return match(tostring(n),"(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)")
end
function number.toevenhex(n)
@@ -39,7 +41,7 @@ end
local one = lpeg.C(1-lpeg.S(''))^1
function number.toset(n)
- return one:match(tostring(n))
+ return lpegmatch(one,tostring(n))
end
function number.bits(n,zero)