Skip to content

Commit

Permalink
Drop "or function" set ups
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Feb 5, 2021
1 parent 44eaf2c commit 7ffcd74
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
6 changes: 3 additions & 3 deletions l3build-check.lua
Expand Up @@ -85,7 +85,7 @@ function checkinit()
return checkinit_hook()
end
checkinit_hook = checkinit_hook or function() return 0 end
function checkinit_hook() return 0 end
local function rewrite(source,result,processor,...)
local file = assert(open(source,"rb"))
Expand Down Expand Up @@ -545,7 +545,7 @@ local function normalize_pdf(content)
stream = true
stream_content = "stream" .. os_newline
elseif not match(line, "^ *$") and
not match(line,"^%%%%Invocation") and
not match(line,"^%%%%Invocation") and
not match(line,"^%%%%%+") then
line = gsub(line,"%/ID( ?)%[<[^>]+><[^>]+>]","/ID%1[<ID-STRING><ID-STRING>]")
new_content = new_content .. line .. os_newline
Expand Down Expand Up @@ -825,7 +825,7 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
end
-- A hook to allow additional tasks to run for the tests
runtest_tasks = runtest_tasks or function(name,run)
function runtest_tasks(name,run)
return ""
end
Expand Down
18 changes: 9 additions & 9 deletions l3build-manifest-setup.lua
Expand Up @@ -54,7 +54,7 @@ for those people who are interested.
--]]
manifest_setup = manifest_setup or function()
function manifest_setup()
local groups = {
{
subheading = "Repository manifest",
Expand Down Expand Up @@ -220,13 +220,13 @@ end
---------------------
--]]
manifest_sort_within_match = manifest_sort_within_match or function(files)
function manifest_sort_within_match(files)
local f = files
table.sort(f)
return f
end
manifest_sort_within_group = manifest_sort_within_group or function(files)
function manifest_sort_within_group(files)
local f = files
--[[
-- no-op by default; make your own definition to customise. E.g.:
Expand All @@ -240,7 +240,7 @@ end
---------------
--]]
manifest_write_opening = manifest_write_opening or function(filehandle)
function manifest_write_opening(filehandle)
filehandle:write("# Manifest for " .. module .. "\n\n")
filehandle:write([[
Expand All @@ -250,7 +250,7 @@ It is automatically generated with `texlua build.lua manifest`.

end

manifest_write_subheading = manifest_write_subheading or function(filehandle,heading,description)
functiom manifest_write_subheading(filehandle,heading,description)

filehandle:write("\n\n## " .. heading .. "\n\n")

Expand All @@ -260,7 +260,7 @@ manifest_write_subheading = manifest_write_subheading or function(filehandle,hea

end

manifest_write_group_heading = manifest_write_group_heading or function (filehandle,heading,description)
function manifest_write_group_heading(filehandle,heading,description)

filehandle:write("\n### " .. heading .. "\n\n")

Expand All @@ -270,7 +270,7 @@ manifest_write_group_heading = manifest_write_group_heading or function (filehan

end

manifest_write_group_file = manifest_write_group_file or function(filehandle,filename,param)
function manifest_write_group_file(filehandle,filename,param)
--[[
filehandle : write file object
filename : the count of the filename to be written
Expand All @@ -296,7 +296,7 @@ manifest_write_group_file = manifest_write_group_file or function(filehandle,fil
end
manifest_write_group_file_descr = manifest_write_group_file_descr or function(filehandle,filename,descr,param)
function manifest_write_group_file_descr(filehandle,filename,descr,param)
--[[
filehandle : write file object
filename : the name of the file to write
Expand Down Expand Up @@ -326,7 +326,7 @@ end
-------------------------------------------
--]]
manifest_extract_filedesc = manifest_extract_filedesc or function(filehandle)
function manifest_extract_filedesc(filehandle)
-- no-op by default; two examples below
Expand Down
3 changes: 1 addition & 2 deletions l3build-manifest.lua
Expand Up @@ -33,7 +33,7 @@ for those people who are interested.
`l3build-manifest-setup.lua`.
--]]
manifest = manifest or function()
function manifest()
-- build list of ctan files
ctanfiles = {}
Expand Down Expand Up @@ -277,4 +277,3 @@ manifest_write_group = function(f,entry)
end
end
3 changes: 1 addition & 2 deletions l3build-tagging.lua
Expand Up @@ -28,7 +28,7 @@ local os_date = os.date
local match = string.match
local gsub = string.gsub
update_tag = update_tag or function(filename,content,tagname,tagdate)
function update_tag(filename,content,tagname,tagdate)
return content
end
Expand Down Expand Up @@ -81,4 +81,3 @@ function tag(tagnames)
end
return tag_hook(tagname,tagdate)
end
7 changes: 3 additions & 4 deletions l3build-typesetting.lua
Expand Up @@ -146,7 +146,7 @@ local function typesetpdf(file,dir)
return cp(pdfname,dir,docfiledir)
end
typeset = typeset or function(file,dir,exe)
function typeset(file,dir,exe)
dir = dir or "."
local errorlevel = tex(file,dir,exe)
if errorlevel ~= 0 then
Expand All @@ -168,7 +168,7 @@ typeset = typeset or function(file,dir,exe)
end
-- A hook to allow additional typesetting of demos
typeset_demo_tasks = typeset_demo_tasks or function()
function typeset_demo_tasks()
return 0
end
Expand Down Expand Up @@ -198,7 +198,7 @@ local function docinit()
return docinit_hook()
end
docinit_hook = docinit_hook or function() return 0 end
function docinit_hook() return 0 end
-- Typeset all required documents
-- Uses a set of dedicated auxiliaries that need to be available to others
Expand Down Expand Up @@ -240,4 +240,3 @@ function doc(files)
end
return 0
end
2 changes: 1 addition & 1 deletion l3build-unpack.lua
Expand Up @@ -46,7 +46,7 @@ end
-- Split off from the main unpack so it can be used on a bundle and not
-- leave only one modules files
bundleunpack = bundleunpack or function(sourcedirs, sources)
function bundleunpack(sourcedirs, sources)
local errorlevel = mkdir(localdir)
if errorlevel ~=0 then
return errorlevel
Expand Down

0 comments on commit 7ffcd74

Please sign in to comment.