diff options
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/third/transliterator/transliterator.lua | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/tex/context/third/transliterator/transliterator.lua b/tex/context/third/transliterator/transliterator.lua index 1bcbb32..4b64d82 100644 --- a/tex/context/third/transliterator/transliterator.lua +++ b/tex/context/third/transliterator/transliterator.lua @@ -47,11 +47,14 @@ translit.ru_consonants = {"б", "в", "г", "д", "ж", "з", "к", "л", "м", -- and -- trans_tables_trsc.lua.} +-------------------------------------------------------------------------------- -- Metatables allow for lazy concatenation. +-------------------------------------------------------------------------------- do -- This returns the Union of both key sets for the “+” operator. - -- The values of the first table will be updated (read: overridden) by those given in the second. + -- The values of the first table will be updated (read: overridden) by + -- those given in the second. local Dict_add = { __add = function (dict_a, dict_b) assert (type(dict_a) == "table" and type(dict_b) == "table") @@ -73,6 +76,10 @@ do end end +-------------------------------------------------------------------------------- +-- Auxiliary Functions +-------------------------------------------------------------------------------- + -- We might want to have all the table data nicely formatted by \CONTEXT\ -- itself, here's how we'll do it. \type{translit.show_tab(t)} handles a -- single table \type{t}, builds a Natural TABLE out of its content and @@ -96,8 +103,6 @@ local strempty = function (s) end end ---function translit.show_tab (tab_name) - --local tab = translit[tab_name] function translit.show_tab (tab) -- Output a transliteration table, nicely formatted with natural tables. -- Lots of calls to context() but as it’s only a goodie this doesn’t @@ -173,6 +178,18 @@ function translit.show_all_tabs () end end +-- for internal use only + +translit.debug_count = 0 + +function translit.debug_next () + translit.debug_count = translit.debug_count + 1 + context("\\tfxx{\\bf translit debug msg. nr.~" .. translit.debug_count .. "}") +end + +-------------------------------------------------------------------------------- +-- User-level Function +-------------------------------------------------------------------------------- -- \type{translit.transliterate(m, t)} constitutes the -- metafunction that is called by the \type{\transliterate} command. @@ -211,10 +228,3 @@ function translit.transliterate (method, text) end context (text) end - -translit.debug_count = 0 --- for internal use only -function translit.debug_next () - translit.debug_count = translit.debug_count + 1 - context("\\tfxx{\\bf translit debug msg. nr.~" .. translit.debug_count .. "}") -end |