diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index 8e175a2e74d..5fe3d23d968 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3names} -\GetIdInfo$Id: l3alloc.dtx 2478 2011-06-19 21:34:23Z joseph $ +\GetIdInfo$Id: l3alloc.dtx 2528 2011-08-09 09:10:06Z joseph $ {L3 Experimental register allocation} %</driver|package> %<*driver> @@ -165,6 +165,63 @@ } % \end{macrocode} % \end{macro} +% +% \begin{macro}{\int_eval:n} +% For bootstrapping purposes, a definition of \cs{int_eval:n} is needed +% in terms of primitives. This is replaced in \pkg{l3int} with a clearer +% one. +% \begin{macrocode} +\cs_new:Npn \int_eval:n #1 { \tex_number:D \etex_numexpr:D #1 \scan_stop: } +% \end{macrocode} +% \end{macro} +% +% \begin{macro} +% {box_new:N, \dim_new:N, \int_new:N, \muskip_new:N \skip_new:N} +% To get everything to work correctly for inserts, some register types +% need to have their allocators set up \enquote{early}. It therefore +% makes sense to collect most of them together here. +% \begin{macrocode} +\alloc_new:nnnN { box } \c_zero \c_max_register_int \tex_mathchardef:D +\alloc_new:nnnN { dim } \c_zero \c_max_register_int \tex_dimendef:D +\alloc_new:nnnN { int } { 11 } \c_max_register_int \tex_countdef:D +\alloc_new:nnnN { muskip } \c_zero \c_max_register_int \tex_muskipdef:D +\alloc_new:nnnN { skip } \c_zero \c_max_register_int \tex_skipdef:D +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\insert_new:N} +% \begin{macro}[aux]{\alloc_reserve_insert:n} +% For inserts, there is a need to reserve space in various other registers. +% \begin{macrocode} +\alloc_new:nnnN { insert } { 221 } { 254 } \tex_chardef:D +\group_begin: + \cs_set_protected_nopar:Npn \alloc_reserve_insert:n #1 + { + \tex_ifnum:D #1 > \c_insert_allocation_max_tl \scan_stop: + \exp_after:wN \use_none:n + \tex_else:D + \exp_after:wN \use:n + \tex_fi:D + { + \seq_put_right:Nn \g_box_allocation_seq {#1} + \seq_put_right:Nn \g_dim_allocation_seq {#1} + \seq_put_right:Nn \g_int_allocation_seq {#1} + \seq_put_right:Nn \g_skip_allocation_seq {#1} + \exp_args:Nf \alloc_reserve_insert:n + { \etex_numexpr:D #1 + 1 \scan_stop: } + } + } + \alloc_reserve_insert:n { 221 } +\group_end: +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Box $255$ is reserved by \TeX{} for output, so is protected here from +% use by the allocator. +% \begin{macrocode} +\seq_put_right:Nn \g_box_allocation_seq { 255 } +% \end{macrocode} % % \begin{macro}[int]{\alloc_reg:nNN} % This internal macro performs the actual allocation. |