diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
commit | b55577d0998160c0174e250b542016ecd6ca9056 (patch) | |
tree | 27093212d5ca3e6ffe4ae434c3ec094233ed37ba /tex/context/base/file-syn.lua | |
parent | 624cbb5da392e9403984dd1cf368c0d408b1c2a8 (diff) | |
download | context-b55577d0998160c0174e250b542016ecd6ca9056.tar.gz |
2015-05-15 23:06:00
Diffstat (limited to 'tex/context/base/file-syn.lua')
-rw-r--r-- | tex/context/base/file-syn.lua | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/tex/context/base/file-syn.lua b/tex/context/base/file-syn.lua index c1f9a5f48..b6ad27c83 100644 --- a/tex/context/base/file-syn.lua +++ b/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" } +} |