diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
commit | f74161ca4e7eb3c5af9afcbe92522ae3b58987c1 (patch) | |
tree | 3c30a13df5ac7968195c85070a2b074578e669d2 /Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua | |
parent | 1d5a55ac8f5506a7ae9cfca52f4b588182e199d4 (diff) |
context beta/cont-tmf.zip (Apr 16 12:55)
git-svn-id: svn://tug.org/texlive/trunk@43931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua | 100 |
1 files changed, 51 insertions, 49 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua index 2743e49243b..a97eadf35ef 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua @@ -26,7 +26,7 @@ local trace_define = false trackers.register("context.define", function(v) tr interfaces = interfaces or { } -_clmh_ = utilities.parsers.settings_to_array +_clmh_ = utilities.parsers.settings_to_hash _clma_ = utilities.parsers.settings_to_array local starters, stoppers, macros, stack = { }, { }, { }, { } @@ -66,6 +66,8 @@ _clmn_ = tonumber local estart = interfaces.elements.start local estop = interfaces.elements.stop +-- this is a bit old definition ... needs to be modernized + function interfaces.definecommand(name,specification) -- name is optional if type(name) == "table" then specification = name @@ -172,51 +174,51 @@ function interfaces.tolist(t) return concat(r,", ") end ---~ \startluacode ---~ function test(opt_1, opt_2, arg_1) ---~ context.startnarrower() ---~ context("options 1: %s",interfaces.tolist(opt_1)) ---~ context.par() ---~ context("options 2: %s",interfaces.tolist(opt_2)) ---~ context.par() ---~ context("argument 1: %s",arg_1) ---~ context.stopnarrower() ---~ end - ---~ interfaces.definecommand { ---~ name = "test", ---~ arguments = { ---~ { "option", "list" }, ---~ { "option", "hash" }, ---~ { "content", "string" }, ---~ }, ---~ macro = test, ---~ } ---~ \stopluacode - ---~ test: \test[1][a=3]{whatever} - ---~ \startluacode ---~ local function startmore(opt_1) ---~ context.startnarrower() ---~ context("start more, options: %s",interfaces.tolist(opt_1)) ---~ context.startnarrower() ---~ end - ---~ local function stopmore(opt_1) ---~ context.stopnarrower() ---~ context("stop more, options: %s",interfaces.tolist(opt_1)) ---~ context.stopnarrower() ---~ end - ---~ interfaces.definecommand ( "more", { ---~ environment = true, ---~ arguments = { ---~ { "option", "list" }, ---~ }, ---~ starter = startmore, ---~ stopper = stopmore, ---~ } ) ---~ \stopluacode - ---~ more: \startmore[1] one \startmore[2] two \stopmore one \stopmore +-- \startluacode +-- function test(opt_1, opt_2, arg_1) +-- context.startnarrower() +-- context("options 1: %s",interfaces.tolist(opt_1)) +-- context.par() +-- context("options 2: %s",interfaces.tolist(opt_2)) +-- context.par() +-- context("argument 1: %s",arg_1) +-- context.stopnarrower() +-- end +-- +-- interfaces.definecommand { +-- name = "test", +-- arguments = { +-- { "option", "list" }, +-- { "option", "hash" }, +-- { "content", "string" }, +-- }, +-- macro = test, +-- } +-- \stopluacode +-- +-- test: \test[1][a=3]{whatever} +-- +-- \startluacode +-- local function startmore(opt_1) +-- context.startnarrower() +-- context("start more, options: %s",interfaces.tolist(opt_1)) +-- context.startnarrower() +-- end +-- +-- local function stopmore(opt_1) +-- context.stopnarrower() +-- context("stop more, options: %s",interfaces.tolist(opt_1)) +-- context.stopnarrower() +-- end +-- +-- interfaces.definecommand ( "more", { +-- environment = true, +-- arguments = { +-- { "option", "list" }, +-- }, +-- starter = startmore, +-- stopper = stopmore, +-- } ) +-- \stopluacode +-- +-- more: \startmore[1] one \startmore[2] two \stopmore one \stopmore |