|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- This file:
-- http://anggtwu.net/LUA/Output1.lua.html
-- http://anggtwu.net/LUA/Output1.lua
-- (find-angg "LUA/Output1.lua")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
--
-- This is a rewrite of output.lua for Dednat7. See:
-- (find-angg "LUA/dednat7load.lua")
-- (find-dn6 "output.lua")
--
-- (find-angggrep "grep --color=auto -nH --null -e output LUA/Dednat7.lua")
dnt_log = dnt_log or ""
Output = Class {
type = "Output",
__call = function (out,...) output:output(...) end,
__tostring = function (out) return "(An Output object)" end,
__index = {
--
-- Low-level destinations
dnt = function (out,bigstr) dnt_log = dnt_log..bigstr.."\n" end,
tex = function (out,bigstr) if tex then tex.print(deletecomments(bigstr)) end end,
print = function (out,bigstr) print(bigstr) end,
--
-- Default action for __call
output = function (out,bigstr) out:print(bigstr); out:tex(bigstr) end,
--
-- Logging
puinfo = function (out,line)
out:print("% Running the \\pu at line "..(line or "(nil)"))
end,
blockinfo = function (out)
out:print(format("%% Running the \"%s\"-block in lines %s",
thisblock.headstr or "", thisblock:ijtostring()))
end,
},
}
output = Output {}
--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "Output1.lua"
= output
output("Hello")
--]]
-- Local Variables:
-- coding: utf-8-unix
-- End: