Skip to content

Commit

Permalink
Template doc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dargueta committed Nov 27, 2024
1 parent 40764db commit adbfcd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
10 changes: 0 additions & 10 deletions config.ld
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ description = "Lua bindings for the Unicorn CPU emulator"
file = {
-- Lua files must come first, as the C files reference them.
"src/unicorn",
-- C files come after Lua files. `unicorn.c` must come first since it declares the C
-- module. Ordering after that doesn't matter.
"csrc/unicorn.c",
--"csrc/basic_control_functions.c",
--"csrc/basic_hook_functions.c",
--"csrc/control_functions.c",
--"csrc/engine.c",
--"csrc/hooks.c",
--"csrc/registers.c",
--"csrc/registers_api.c",
exclude = {
-- Unfortunately LDoc can't handle globs
"src/unicorn/arm64_const.lua",
Expand Down
19 changes: 8 additions & 11 deletions tools/render_template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
-- with this program; if not, write to the Free Software Foundation, Inc.,
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

lapp = require "pl.lapp"
stringx = require "pl.stringx"
tablex = require "pl.tablex"
template = require "pl.template"
utils = require "pl.utils"
local lapp = require "pl.lapp"
local stringx = require "pl.stringx"
local tablex = require "pl.tablex"
local template = require "pl.template"
local utils = require "pl.utils"


COPYRIGHT_NOTICE = [[
Copyright (C) 2017-2024 by Diego Argueta
local COPYRIGHT_NOTICE = [[Copyright (C) 2017-2024 by Diego Argueta
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -36,8 +35,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
]]
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.]]


USAGE = [[
Expand Down Expand Up @@ -115,10 +113,9 @@ function main()
environment._inline_escape = string.sub(args.inline_escape, 1, 1)
environment._brackets = string.sub(args.inline_escape, 2, 3)
environment._parent = {ipairs = ipairs, pairs = pairs}
environment._chunk_name = "template"
environment._chunk_name = args.template

local rendered_text, err, _compiled = template.substitute(template_text, environment)

if err then
utils.quit(1, "Error rendering template: %s", err)
end
Expand Down

0 comments on commit adbfcd2

Please sign in to comment.