diff options
author | Karl Berry <karl@freefriends.org> | 2007-05-22 17:46:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-05-22 17:46:23 +0000 |
commit | f4eb27d3314d15838f674a3872000159d029f88b (patch) | |
tree | 6e9ab33c5a2d702912b4a969ade4e4e2ac586d62 /Master/texmf-dist/tex/latex/expl3/l3toks.sty | |
parent | 14af3f447439750920f754792b89f113d019076a (diff) |
update expl3
git-svn-id: svn://tug.org/texlive/trunk@4335 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3toks.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/expl3/l3toks.sty | 118 |
1 files changed, 106 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3toks.sty b/Master/texmf-dist/tex/latex/expl3/l3toks.sty index 3db8ed5adbb..d950644fa85 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3toks.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3toks.sty @@ -15,19 +15,51 @@ %% Do not distribute a modified version of this file. %% %% -%% File: l3toks.dtx Copyright (C) 1990-1998 LaTeX3 project -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{l3toks} - [1998/05/14 v1.0g L3 Experimental Token Registers] +%% File: l3toks.dtx Copyright (C) 1990-2006 LaTeX3 project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``expl3 bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +\RequirePackage{l3names} +\GetIdInfo$Id: l3toks.dtx 580 2006-11-26 15:56:47Z morten $ + {L3 Experimental Token Registers} \RequirePackage{l3expan}\par -\def_new:Npn \toks_new:N {} \let:NN \toks_new:N \newtoks % nick from LaTeX for the moment +\def_new:Npn \toks_new:c {\exp_args:Nc\toks_new:N} \def_new:Npn \toks_clear:N #1{#1\c_empty_toks } \def_new:Npn \toks_gclear:N { \pref_global:D \toks_clear:N} \let_new:NN \toks_use:N \the_internal:D +\def_new:Npn \toks_use:c {\exp_args:Nc\toks_use:N} \def_new:Npn \toks_use_clear:N#1{ \exp_after:NN \toks_clear:N @@ -37,30 +69,86 @@ \def_new:Npn \toks_use_gclear:N{ \pref_global:D \toks_use_clear:N} -\def_new:Npn \toks_put_left:Nn #1{\exp_after:NN\toks_put_left_aux:w +\def_new:Npn \toks_put_left:Nn #1{ + \exp_after:NN\toks_put_left_aux:w\exp_after:NN\q_mark \toks_use:N #1\q_stop #1} +\def_new:Npn \toks_put_left:No {\exp_args:NNo \toks_put_left:Nn} \def_new:Npn \toks_gput_left:Nn { \pref_global:D \toks_put_left:Nn} -\def_long_new:Npn \toks_put_left_aux:w #1\q_stop #2#3{#2{#3#1} +\def_new:Npn \toks_gput_left:Nx {\exp_args:NNx \toks_gput_left:Nn} +\def_long_new:Npn \toks_put_left_aux:w #1\q_stop #2#3{ + #2\exp_after:NN{\use_arg_i:nn{#3}#1} } \def_long_new:Npn \toks_put_right:Nn #1#2{#1\exp_after:NN{\toks_use:N #1#2} } \def_new:Npn \toks_gput_right:Nn { \pref_global:D \toks_put_right:Nn} -\def_new:Npn \toks_gput_right:Nx {\exp_args:Nnx\toks_gput_right:Nn} +\def_long_new:Npn\toks_put_right:No#1#2{#1\exp_after:NN\exp_after:NN +\exp_after:NN{\exp_after:NN\toks_use:N\exp_after:NN #1#2}} +\def_long_new:Npn\toks_put_right:Nd#1#2{ + \exp_after:NN\toks_put_right:No\exp_after:NN#1\exp_after:NN{#2}} +\def_long_new:Npn \toks_put_right:Nf #1#2{ + #1\exp_after:NN\exp_after:NN\exp_after:NN{ + \exp_after:NN\toks_use:N\exp_after:NN #1\int_to_roman:w -`0#2}} +\def_new:Npn \toks_put_right:Nx {\exp_args:NNx \toks_put_right:Nn } +\def_new:Npn \toks_gput_right:No {\exp_args:NNo\toks_gput_right:Nn} +\def_new:Npn \toks_gput_right:Nx {\exp_args:NNx\toks_gput_right:Nn} \let_new:NN \toks_set:Nn\use_noop: -\def_new:Npn \toks_set:No {\exp_args:NNo \toks_set:Nn} + \def_long_new:Npn \toks_set:No#1#2{#1\exp_after:NN{#2}} + \def_long_new:Npn \toks_set:Nd#1#2{ + #1\exp_after:NN\exp_after:NN\exp_after:NN{#2}} \def_new:Npn \toks_set:Nx {\exp_args:NNx \toks_set:Nn} +\def_long_new:Npn\toks_set:Nf #1#2{ + #1\exp_after:NN{\int_to_roman:w -`0#2}} +\def_new:Npn \toks_set:cf {\exp_args:Nc\toks_set:Nf} +\def_new:Npn \toks_set:cn {\exp_args:Nc\toks_set:Nn} +\def_new:Npn \toks_set:co {\exp_args:Nc\toks_set:No} +\def_new:Npn \toks_set:cx {\exp_args:Nc\toks_set:Nx} \let_new:NN \toks_gset:Nn\pref_global:D \def_new:Npn \toks_gset:No {\exp_args:NNo \toks_gset:Nn} \def_new:Npn \toks_gset:Nx {\exp_args:NNx \toks_gset:Nn} +\def_new:Npn \toks_gset:cn {\exp_args:Nc \toks_gset:Nn} +\def_new:Npn \toks_gset:co {\exp_args:Nc \toks_gset:No} +\def_new:Npn \toks_gset:cx {\exp_args:Nc \toks_gset:Nx} \let_new:NN \toks_set_eq:NN \use_noop: \let_new:NN \toks_gset_eq:NN \pref_global:D -\def_new:Npn\toks_empty:NTF#1{ - \tlp_set:No\l_testa_tlp{\toks_use:N#1} - \tlp_empty:NTF\l_testa_tlp} +\def_new:Npn \toks_set_eq:Nc {\exp_args:NNc\toks_set_eq:NN} +\def_new:Npn \toks_set_eq:cN {\exp_args:Nc\toks_set_eq:NN} +\def_new:Npn \toks_set_eq:cc {\exp_args:Ncc\toks_set_eq:NN} +\def_new:Npn \toks_gset_eq:Nc {\exp_args:NNc\toks_gset_eq:NN} +\def_new:Npn \toks_gset_eq:cN {\exp_args:Nc\toks_gset_eq:NN} +\def_new:Npn \toks_gset_eq:cc {\exp_args:Ncc\toks_gset_eq:NN} +\def_new:Npn\toks_if_empty_p:N#1{ + \if:w \tlist_if_empty_p:o{\toks_use:N #1} + \c_true + \else: + \c_false + \fi: +} +\def_test_function_new:npn{toks_if_empty:N}#1{\if:w \toks_if_empty_p:N #1} +\def_new:Npn\toks_if_empty:cTF{\exp_args:Nc\toks_if_empty:NTF} +\def_new:Npn\toks_if_empty:cT{\exp_args:Nc\toks_if_empty:NT} +\def_new:Npn\toks_if_empty:cF{\exp_args:Nc\toks_if_empty:NF} +\def_new:NNn \toks_if_eq:NNTF 2 { + \tlist_if_eq:xxTF{\toks_use:N #1}{\toks_use:N #2} +} +\def_new:NNn \toks_if_eq:NNT 2 { + \tlist_if_eq:xxT{\toks_use:N #1}{\toks_use:N #2} +} +\def_new:NNn \toks_if_eq:NNF 2 { + \tlist_if_eq:xxF{\toks_use:N #1}{\toks_use:N #2} +} +\def_new:Npn \toks_if_eq:NcTF {\exp_args:NNc \toks_if_eq:NNTF} +\def_new:Npn \toks_if_eq:NcT {\exp_args:NNc \toks_if_eq:NNT} +\def_new:Npn \toks_if_eq:NcF {\exp_args:NNc \toks_if_eq:NNF} +\def_new:Npn \toks_if_eq:cNTF {\exp_args:Nc \toks_if_eq:NNTF} +\def_new:Npn \toks_if_eq:cNT {\exp_args:Nc \toks_if_eq:NNT} +\def_new:Npn \toks_if_eq:cNF {\exp_args:Nc \toks_if_eq:NNF} +\def_new:Npn \toks_if_eq:ccTF {\exp_args:Ncc \toks_if_eq:NNTF} +\def_new:Npn \toks_if_eq:ccT {\exp_args:Ncc \toks_if_eq:NNT} +\def_new:Npn \toks_if_eq:ccF {\exp_args:Ncc \toks_if_eq:NNF} \tex_toksdef:D \l_tmpa_toks = 255 \toks_new:N \l_tmpb_toks \toks_new:N \l_tmpc_toks @@ -68,6 +156,12 @@ \toks_new:N \g_tmpb_toks \toks_new:N \g_tmpc_toks \toks_new:N \c_empty_toks +\def_new:Npn \toks_remove_extra_brace_group:N #1{ + \exp_after:NN \toks_remove_extra_brace_group_aux:NNw + \exp_after:NN \toks_set:Nn \exp_after:NN #1 + \toks_use:N#1\q_nil +} +\def_long_new:Npn\toks_remove_extra_brace_group_aux:NNw #1#2#3\q_nil{#1#2{#3}} %% %% %% End of file `l3toks.sty'. |