diff options
Diffstat (limited to 'tex/context/base/mkiv/cldf-stp.lua')
-rw-r--r-- | tex/context/base/mkiv/cldf-stp.lua | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/cldf-stp.lua b/tex/context/base/mkiv/cldf-stp.lua index 389cfb7f7..2ce6341b3 100644 --- a/tex/context/base/mkiv/cldf-stp.lua +++ b/tex/context/base/mkiv/cldf-stp.lua @@ -55,17 +55,50 @@ interfaces.implement { local ctx_resume = context.protected.cs.clf_step -function context.step(first,...) - if first ~= nil then - context(first,...) +local closeinput = texio.closeinput -- experiment +local closeindeed = true +local stepsindeed = true + +directives.register("context.steps.nosteps",function(v) stepsindeed = not v end) +directives.register("context.steps.noclose",function(v) closeindeed = not v end) + +if closeinput then + + function context.step(first,...) + if first ~= nil then + context(first,...) + end +if stepper then + ctx_resume() + yield() + if closeindeed then + closeinput() + end +end + end + +else + + function context.step(first,...) + if first ~= nil then + context(first,...) + end +if stepper then + ctx_resume() + yield() +end end - ctx_resume() - yield() + end function context.stepwise(f) - depth = depth + 1 - stack[depth] = stepper - stepper = create(f) - ctx_resume(stepper) + if stepsindeed then + depth = depth + 1 + stack[depth] = stepper + stepper = create(f) + -- ctx_resume(stepper) + ctx_resume() + else + f() + end end |