diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua index 88605631d84..d9178b1dfc9 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua @@ -43,7 +43,6 @@ local findfile = resolvers.findfile local addsuffix = file.addsuffix local v_yes = variables.yes -local v_no = variables.no local v_last = variables.last local v_all = variables.all local v_absolute = variables.absolute @@ -142,8 +141,7 @@ local functions = { __index = { local handlers = { } function visualizers.newhandler(name,data) - local tname = type(name) - local tdata = type(data) + local tname, tdata = type(name), type(data) if tname == "table" then -- (data) setmetatable(name,getmetatable(name) or functions) return name @@ -257,7 +255,7 @@ function visualizers.load(name) if trace_visualize then report_visualizers("loading visualizer %a",name) end - lua.registercode(luaname) -- only used here, end up in format + lua.registercode(luaname) context.input(texname) end if rawget(specifications,name) == nil then @@ -447,7 +445,7 @@ function visualizers.registerescapecommand(name,token,normalmethod,escapecommand end token = P(token) local notoken = hack((1 - token)^1) - local cstoken = Cs(name_pattern * (space_pattern/"")) + local cstoken = name_pattern * space_pattern escapepattern = ( (token / "") * (cstoken / (escapecommand or texcommand)) @@ -616,12 +614,7 @@ end local onlyspaces = S(" \t\f\n\r")^0 * P(-1) local function getstrip(lines,first,last) - if not first then - first = 1 - end - if not last then - last = #lines - end + local first, last = first or 1, last or #lines for i=first,last do local li = lines[i] if #li == 0 or lpegmatch(onlyspaces,li) then @@ -743,14 +736,12 @@ end local function filter(lines,settings) -- todo: inline or display in settings local strip = settings.strip - -- if strip and strip == "" then - if strip ~= v_no and strip ~= false then + if strip and strip ~= "" then lines = realign(lines,strip) end - local line = 0 - local n = 0 - local range = settings.range + local line, n = 0, 0 local first, last, m = getstrip(lines) + local range = settings.range if range then first, last = getrange(lines,first,last,range) first, last = getstrip(lines,first,last) |