summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/ltj-tangle.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-25 21:24:56 +0000
committerKarl Berry <karl@freefriends.org>2018-03-25 21:24:56 +0000
commit23d0d97724c62d6df3f1e92c73a6cb6b1fc8d790 (patch)
tree986639040d862bbd83289fbf39aea8231e58d43a /Master/texmf-dist/tex/luatex/luatexja/ltj-tangle.lua
parent13e15ec770037fb7e4c70acbad0bd42bd841affd (diff)
luatexja (25mar18)
git-svn-id: svn://tug.org/texlive/trunk@47107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/ltj-tangle.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-tangle.lua76
1 files changed, 0 insertions, 76 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-tangle.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-tangle.lua
deleted file mode 100644
index 752d7ae2bb4..00000000000
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-tangle.lua
+++ /dev/null
@@ -1,76 +0,0 @@
---
--- luatexja/tangle.lua
---
-luatexbase.provides_module({
- name = 'luatexja.tangle',
- date = '2011/05/14',
- description = '',
-})
-module('luatexja.tangle', package.seeall)
-local err, warn, info, log = luatexbase.errwarinf(_NAME)
-
---! ixbase0 からの移植
-
-local _DONE, _TEX, _STOP = 0, 1, 2
-local _current_co, _interrupted
-local _resume, _check
-
-local resume_code =
- "\\directlua{".._NAME..".resume()}\\relax"
-
-function execute(func, ...)
- if _current_co then
- err("tangle is going now")
- end
- local args = { ... }
- local co = coroutine.create(function()
- return _DONE, { func(unpack(args)) }
- end)
- _current_co = co
- _interrupted = false
- return _check(coroutine.resume(co, ...))
-end
-
-function resume()
- return _resume(false)
-end
-
-function interrupt()
- return _resume(true)
-end
-
-function run_tex()
- coroutine.yield(_TEX, {})
-end
-
-function suspend(...)
- local intr = coroutine.yield(_STOP, { ... })
- if intr then
- _interrupted = true
- error("*INTR*") -- this error is caught later
- end
-end
-
-function _resume(intr)
- if not _current_co then
- err("tangle is not going")
- end
- local co = _current_co
- return _check(coroutine.resume(co, intr))
-end
-
-function _check(costat, tstat, extra)
- if not costat then -- error in coroutine
- _current_co = nil
- if _interrupted then return end
- err(tstat)
- elseif tstat == _DONE then
- _current_co = nil
- elseif tstat == _TEX then
- tex.print(resume_code)
- end
- return unpack(extra)
-end
-
--- EOF
-