diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-26 23:57:02 +0100 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-26 23:57:02 +0100 |
commit | 23a17df502ce5f8b360c1e10bc0dedae87631788 (patch) | |
tree | 3776e6aca7498a71759bc7319fb4c527018b3417 | |
parent | 548cf785083785c27869a8b035156dbe2c127c29 (diff) | |
download | luatexbase-23a17df502ce5f8b360c1e10bc0dedae87631788.tar.gz |
fix allocation range; initilase tables
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | luatexbase-cctb.dtx | 26 |
2 files changed, 16 insertions, 12 deletions
@@ -3,6 +3,8 @@ 2010/03/26 luatexbase-cctb - add minimal test files for luatex and lualatex + - fix allocation range (1->65535) + - make sure newly allocated tables are initialised 2010/03/11 luatexbase-attrs 0.1 diff --git a/luatexbase-cctb.dtx b/luatexbase-cctb.dtx index 7ac8a2e..a73f483 100644 --- a/luatexbase-cctb.dtx +++ b/luatexbase-cctb.dtx @@ -203,21 +203,23 @@ and the derived files \directlua{dofile(kpse.find_file('luatexbase.cctb.lua', 'lua'))} % \end{macrocode} % -% The allocation macro. +% The allocation macro. Allocate tables starting with 1, since table 0 is +% reserved for IniTeX catcodes by LuaTeX. % % \begin{macrocode} -\newcount\luatexcatcodetabledefcounter -\luatexcatcodetabledefcounter = 1 +\newcount\lltxb@catcodetable@alloc +\lltxb@catcodetable@alloc\z@ \def\newluatexcatcodetable#1{% - \ifnum\luatexcatcodetabledefcounter<1114110\relax % 0x10FFFF is maximal \chardef - \global\advance\luatexcatcodetabledefcounter by 1\relax - \allocationnumber=\luatexcatcodetabledefcounter - \global\chardef#1=\allocationnumber - \directlua{% - luatextra.catcodetabledef_from_tex([[\noexpand#1]], '\number\allocationnumber')}% - \wlog{\string#1=\string\catcodetable\the\allocationnumber}% + \ifnum\lltxb@catcodetable@alloc<65535\relax + \global\advance\lltxb@catcodetable@alloc\@ne + \allocationnumber\lltxb@catcodetable@alloc + \global\chardef#1\allocationnumber + \luatexinitcatcodetable\allocationnumber + \directlua{luatextra.catcodetabledef_from_tex( + '\luatexluaescapestring{\string#1}', '\number\allocationnumber')}% + \wlog{\string#1=\string\luatexcatcodetable\the\allocationnumber}% \else - \errmessage{No room for a new \string\catcodetable}% + \errmessage{No room for a new \string\luatexcatcodetable}% \fi} % \end{macrocode} % @@ -277,7 +279,7 @@ and the derived files \newluatexcatcodetable\CatcodeTableLaTeX \newluatexcatcodetable\CatcodeTableLaTeXAtLetter \newluatexcatcodetable\CatcodeTableExpl -\luatexinitcatcodetable\CatcodeTableIniTeX +%% \luatexinitcatcodetable\CatcodeTableIniTeX \expandafter\ifx\csname @firstofone\endcsname\relax \long\def\@firstofone#1{#1}% |