summaryrefslogtreecommitdiff
path: root/tex/context/base/luat-sta.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/luat-sta.lua
parent326b0613f1ed21f5711a8d94403512171c058e48 (diff)
downloadcontext-5eb872dbc6bbc35e222d5b23fc783fb0e75d4a99.tar.gz
beta 2009.12.29 22:32
Diffstat (limited to 'tex/context/base/luat-sta.lua')
-rw-r--r--tex/context/base/luat-sta.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/tex/context/base/luat-sta.lua b/tex/context/base/luat-sta.lua
index 12fa18219..cc78851a9 100644
--- a/tex/context/base/luat-sta.lua
+++ b/tex/context/base/luat-sta.lua
@@ -7,6 +7,9 @@ if not modules then modules = { } end modules ['luat-sta'] = {
-- this code is used in the updater
+local gmatch, match = string.gmatch, string.match
+local type = type
+
states = states or { }
states.data = states.data or { }
states.hash = states.hash or { }
@@ -35,9 +38,9 @@ function states.set_by_tag(tag,key,value,default,persistent)
if d then
if type(d) == "table" then
local dkey, hkey = key, key
- local pre, post = key:match("(.+)%.([^%.]+)$")
+ local pre, post = match(key,"(.+)%.([^%.]+)$")
if pre and post then
- for k in pre:gmatch("[^%.]+") do
+ for k in gmatch(pre,"[^%.]+") do
local dk = d[k]
if not dk then
dk = { }
@@ -69,7 +72,7 @@ function states.get_by_tag(tag,key,default)
else
local d = states.data[tag]
if d then
- for k in key:gmatch("[^%.]+") do
+ for k in gmatch(key,"[^%.]+") do
local dk = d[k]
if dk then
d = dk