diff options
author | Karl Berry <karl@freefriends.org> | 2015-12-02 22:25:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-12-02 22:25:24 +0000 |
commit | 8a154ca7d78ee39d443c3f43d9cb86ff1d71b411 (patch) | |
tree | aece0f86dda1a199e831661af24593dc4184b1e9 /Master/texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua | |
parent | cd10cbba5784b911a3028369ffaa9e87e9a746aa (diff) |
lualibs (2dec15)
git-svn-id: svn://tug.org/texlive/trunk@38998 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua index 1a61ec4e6c4..27ab5a624b6 100644 --- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua +++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua @@ -81,6 +81,8 @@ end function stacker.new(name) + local report = logs.reporter("stacker",name or nil) + local s local stack = { } @@ -126,8 +128,18 @@ function stacker.new(name) end end - local tops = { } - local top, switch + local tops = { } + local top = nil + local switch = nil + + local function resolve_reset(mode) + if #tops > 0 then + report("resetting %s left-over states of %a",#tops,name) + end + tops = { } + top = nil + switch = nil + end local function resolve_begin(mode) if mode then @@ -206,8 +218,7 @@ function stacker.new(name) local function resolve_end() -- resolve_step(s.unset) - local noftop = #top - if noftop > 0 then + if #tops > 0 then -- was #top brrr local result = s.stop(s,top,1,#top) remove(tops) top = tops[#tops] @@ -224,8 +235,6 @@ function stacker.new(name) resolve_end() end - local report = logs.reporter("stacker",name or nil) - s = { name = name or "unknown", unset = -1, @@ -240,6 +249,7 @@ function stacker.new(name) resolve_begin = resolve_begin, resolve_step = resolve_step, resolve_end = resolve_end, + resolve_reset = resolve_reset, } return s -- we can overload functions |