diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/file-syn.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/file-syn.lua | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/file-syn.lua b/Master/texmf-dist/tex/context/base/file-syn.lua index c1f9a5f4817..b6ad27c8325 100644 --- a/Master/texmf-dist/tex/context/base/file-syn.lua +++ b/Master/texmf-dist/tex/context/base/file-syn.lua @@ -6,13 +6,16 @@ if not modules then modules = { } end modules ['file-syn'] = { license = "see context related readme files" } -local report_files = logs.reporter("files") environment.filesynonyms = environment.filesynonyms or { } local filesynonyms = environment.filesynonyms -local settings_to_array = utilities.parsers.settings_to_array -local findfile = resolvers.findfile +local settings_to_array = utilities.parsers.settings_to_array +local findfile = resolvers.findfile + +local implement = interfaces.implement + +local report_files = logs.reporter("files") storage.register("environment/filesynonyms", filesynonyms, "environment.filesynonyms") @@ -27,11 +30,7 @@ end environment.truefilename = truefilename -function commands.truefilename(name) - context(truefilename(name)) -end - -function commands.definefilesynonym(name,realname) +function environment.definefilesynonym(name,realname) local names = settings_to_array(name) for i=1,#names do local name = names[i] @@ -43,7 +42,7 @@ function commands.definefilesynonym(name,realname) end end -function commands.definefilefallback(name,alternatives) +function environment.definefilefallback(name,alternatives) local names = settings_to_array(alternatives) for i=1,#names do local realname = findfile(names[i]) @@ -53,3 +52,21 @@ function commands.definefilefallback(name,alternatives) end end end + +implement { + name = "truefilename", + actions = { truefilename, context }, + arguments = "string" +} + +implement { + name = "definefilesynonym", + actions = environment.definefilesynonym, + arguments = { "string", "string" } +} + +implement { + name = "definefilefallback", + actions = environment,definefilefallback, + arguments = { "string", "string" } +} |