Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- heads6.lua: override the dednat5-ish heads with dednat6-ish ones. -- This file: -- http://angg.twu.net/dednat5/heads6.lua -- http://angg.twu.net/dednat5/heads6.lua.html -- (find-angg "dednat5/heads6.lua") -- -- Temporary!!!!!!!! See: -- (find-dn5 "process.lua") -- (find-dn5 "process.lua" "main-loop") -- (find-dn5 "process.lua" "lua-head") -- (find-dn5 "diagforth.lua" "diag-head") -- (find-dn5 "treehead.lua" "tree-head") -- (find-dn5 "begriff.lua" "begriff_head") -- heads = heads or {} -- heads["%"] = nil -- «.registerhead» (to "registerhead") -- «.abbrev-head» (to "abbrev-head") -- «.lua-head» (to "lua-head") -- «.tree-head» (to "tree-head") -- «.diag-head» (to "diag-head") -- «.zrect-head» (to "zrect-head") -- «registerhead» (to ".registerhead") -- (find-dn5grep "grep -nH -e registerhead *.lua") -- (find-dn5 "process.lua" "registerhead") -- (find-dn5 "texfile.lua" "Texfile") -- (find-dn5 "texfile.lua" "Texfile" "process1 =") heads = {} registerhead = function (headstr) return function (head) head.headstr = headstr heads[headstr] = head end end registerhead "" {} -- «abbrev-head» (to ".abbrev-head") -- (find-dn5 "process.lua" "abbrev-head") registerhead "%:*" { name="abbrev", action = function () local abbrev, expansion = linestr:match("^%%:*(.-)*(.-)*") assert(abbrev) addabbrev(abbrev, expansion) end, } -- «lua-head» (to ".lua-head") -- (find-dn5 "process.lua" "lua-head") registerhead "%L" { name = "lua", -- Falta acrescentar o "name" nos outros heads? action = function () local i,j,lualines = tf:getblock() local chunkname = tf.name..":%L:"..i local luacode = table.concat(lualines, "\n") assert(loadstring(luacode, chunkname))() end, } -- «tree-head» (to ".tree-head") -- (find-dn5 "treehead.lua" "tree-head") registerhead "%:" { name = "tree", action = function () nline = tf.nline allsegments[nline] = tosegments(linestr, nline) for _,seg in ipairs(allsegments[nline]) do local name = seg.t:match("^%^(.*)") if name then output(seg:rootnode():totreenode():TeX_deftree(name)) end end end, } -- «diag-head» (to ".diag-head") -- (find-dn5 "diagforth.lua" "diag-head") registerhead "%D" { name ="diag", action = function () -- PP(linestr) dxyrun(untabify(linestr), 3) end, } -- «zrect-head» (to ".zrect-head") -- (find-dn5 "zrect.lua" "zrectdefs_get") -- (find-dn5 "zrect.lua" "zrectdefs_get" "zrectdefs_get =") registerhead "%R" { name ="zrect", action = function () local i,j,lines = tf:getblock() -- PP("AAAA", i, j, lines) -- PP(tf:getblock()) -- PP("AAAAA", i, j, tf.lines.zrect) -- zrectdefs_get(tf.lines.zrect, i, j) zrectdefs_get(lines, 1, #lines) -- PP("CCCCC") end, } --[[ * (eepitch-lua51) * (eepitch-kill) * (eepitch-lua51) dofile "heads6.lua" --]] -- Local Variables: -- coding: raw-text-unix -- End: