diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl index b087832e04b..66a020a141d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl @@ -13,30 +13,74 @@ \writestatus{loading}{ConTeXt Language Macros / Transliteration} -\registerctxluafile{lang-tra}{} +\registerctxluafile{lang-tra}{autosuffix} \unprotect +\installcorenamespace {transliteration} + +\installcommandhandler \??transliteration {transliteration} \??transliteration + \definesystemattribute[transliteration][public,global] -\installcorenamespace {transliteration} +\newtoks\everytransliterations + +\appendtoks + \disablediscretionaries + % \let~=\lettertilde + \enforced\letcharcode\tildeasciicode\lettertilde + % \let|=\letterbar + % \enforced\letcharcode\barasciicode\letterbar +\to \everytransliterations -\permanent\tolerant\protected\def\definetransliteration[#1]#*[#2]% - {\clf_definedtransliteration{#1}{#2}} +\def\lang_transliteration_common + {\usetransliterationstyleandcolor\c!style\c!color + \uselanguageparameter\transliterationparameter + \clf_settransliteration{\currenttransliteration}{\transliterationparameter\c!vector}% + \the\everytransliterations} -\permanent\protected\def\settransliteration[#1]% - {\clf_settransliteration{#1}} +\permanent\tolerant\protected\def\settransliteration[#1]#;#2% + {\edef\currenttransliteration{#1#2}% + \lang_transliteration_common} -\permanent\protected\def\starttransliteration[#1]% +\permanent\protected\def\transliterationexception[#1]#2#3% + {\clf_transliterationexception{#1}{#2}{#3}} + +\permanent\tolerant\protected\def\starttransliteration[#1]#*[#2]% {\begingroup - \clf_settransliteration{#1}} + \edef\currenttransliteration{#1}% + \ifparameter#2\or + \setupcurrenttransliteration[#2]% + \fi + \transliterationparameter\c!before\relax + \lang_transliteration_common} \permanent\protected\def\stoptransliteration - {\endgroup} + {\transliterationparameter\c!after\relax + \endgroup} + +\permanent\tolerant\protected\def\transliteration[#1]#;#2% + {\groupedcommand + {\edef\currenttransliteration{#1#2}% + \lang_transliteration_common + \transliterationparameter\c!left\relax} + {\transliterationparameter\c!right\relax}} + +\appendtoks + \clf_registertransliteration{\currenttransliterationparent}{\currenttransliteration}% + \ifcstok{\transliterationparameter\c!define}\v!yes + \frozen\protected\instance\edefcsname\e!start\currenttransliteration\endcsname{\starttransliteration[\currenttransliteration]}% + \frozen\protected\instance\edefcsname\e!stop \currenttransliteration\endcsname{\stoptransliteration}% + \frozen\protected\instance\edefcsname \currenttransliteration\endcsname{\transliteration[\currenttransliteration]}% + \fi +\to \everydefinetransliteration \permanent\protected\def\resettransliteration {\c_attr_transliteration\attributeunsetvalue} +\setuptransliteration + [\c!define=\v!yes] + \appendtoks \resettransliteration \to \everyinitializeverbatim |