diff options
author | Karl Berry <karl@freefriends.org> | 2009-06-09 23:31:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-06-09 23:31:15 +0000 |
commit | 215b9a864d5829070bdc66ba736986eb72e5143e (patch) | |
tree | fe0882c81fc4ec945cee4b512f72eaa21ea5f791 /Master/texmf-dist/source/latex/expl3/l3keyval.dtx | |
parent | df90ec06321940c2f066b05e12f1b5ab099105da (diff) |
expl3 1407 (9jun09)
git-svn-id: svn://tug.org/texlive/trunk@13686 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3keyval.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3keyval.dtx | 273 |
1 files changed, 157 insertions, 116 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3keyval.dtx b/Master/texmf-dist/source/latex/expl3/l3keyval.dtx index 4134b0fef51..8ac747e5d0a 100644 --- a/Master/texmf-dist/source/latex/expl3/l3keyval.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3keyval.dtx @@ -1,5 +1,5 @@ % \iffalse -%% File: l3keyval.dtx Copyright (C) 2006 LaTeX3 project +%% File: l3keyval.dtx Copyright (C) 2006-2009 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 @@ -17,7 +17,7 @@ %% %% The development version of the bundle can be found at %% -%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% http://www.latex-project.org/svnroot/experimental/trunk/ %% %% for those people who are interested. %% @@ -35,7 +35,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3keyval.dtx 621 2007-09-01 20:14:19Z morten $ +\GetIdInfo$Id: l3keyval.dtx 1362 2009-05-28 20:19:21Z joseph $ {L3 Experimental keyval processing} %\iffalse %<*driver> @@ -43,9 +43,9 @@ \ProvidesFile{\filename.\filenameext} [\filedate\space v\fileversion\space\filedescription] %\iffalse -\documentclass{l3doc} +\documentclass[full]{l3doc} \begin{document} -\DocInput{\filename.\filenameext} +\DocInput{l3keyval.dtx} \end{document} %</driver> % \fi @@ -59,6 +59,8 @@ % \date{\filedate} % \maketitle % +% \begin{documentation} +% % \section{Introduction} % % Currently, this module only provides functions for extracting keys @@ -109,16 +111,13 @@ % two functions before starting the parsing process. % % -% \subsection{Functions} -% -% -% +% \section{Functions} % % \begin{function}{ % \KV_parse_no_space_removal_no_sanitize:n | % } % \begin{syntax} -% "\KV_parse_no_space_removal_no_sanitize:n" "{"<keyval list>"}" +% "\KV_parse_no_space_removal_no_sanitize:n" \Arg{keyval list} % \end{syntax} % Parses the keys and values literally. For use when spaces are % ignored and |=| and |,| have normal catcodes. @@ -128,7 +127,7 @@ % \KV_parse_space_removal_no_sanitize:n | % } % \begin{syntax} -% "\KV_parse_space_removal_no_sanitize:n" "{"<keyval list>"}" +% "\KV_parse_space_removal_no_sanitize:n" \Arg{keyval list} % \end{syntax} % As above but also removes spaces around keys and values. For use % when spaces are not ignored. @@ -138,7 +137,7 @@ % \KV_parse_space_removal_sanitize:n | % } % \begin{syntax} -% "\KV_parse_space_removal_sanitize:n" "{"<keyval list>"}" +% "\KV_parse_space_removal_sanitize:n" \Arg{keyval list} % \end{syntax} % As above but additionally also replaces top-level active |=| and % |,| with harmless versions. @@ -166,43 +165,91 @@ % \KV_key_value_elt:nn | % } % \begin{syntax} -% "\KV_key_no_value_elt:n" "{"<key>"}" \\ -% "\KV_key_value_elt:n" "{"<key>"}" "{"<value>"}" +% "\KV_key_no_value_elt:n" \Arg{key} \\ +% "\KV_key_value_elt:n" \Arg{key} \Arg{value} % \end{syntax} % Functions returned by the |\KV_parse_| functions. The default % definition of these two functions is an error message! % \end{function} % +% \end{documentation} +% +% \begin{implementation} +% +% \section{\pkg{l3keyval} implementation} +% +% \subsection{Internal functions and variables} +% +% \begin{variable}{ \l_KV_tmpa_tl | \l_KV_tmpb_tl | +% \c_KV_single_equal_sign_tl | +% \l_KV_parse_toks | \l_KV_currkey_toks | +% \l_KV_currval_toks } +% Token list variables and token registers used internally. +% \end{variable} +% +% \begin{function}{ \KV_sanitize_outerlevel_active_equals:N | +% \KV_sanitize_outerlevel_active_commas:N } +% \begin{syntax} +% "\KV_sanitize_outerlevel_active_equals:N" <tl var.> +% \end{syntax} +% Replaces catcode other "=" and "," within a <tl var.> with active characters. +% \end{function} +% +% \begin{function}{ \KV_remove_surrounding_spaces:nw | +% \KV_remove_surrounding_spaces_auxi:w / (EXP) } +% \begin{syntax} +% +% "\KV_remove_surrounding_spaces:nw" <toks> <token list> "\q_nil" +% "\KV_remove_surrounding_spaces_auxi:w" <token list> \verb*" Q"$\sb3$ +% \end{syntax} +% Removes a possible +% leading space plus a possible ending space from a <token list>. +% The first version (which is not used in the code) stores it in <toks>. +% \end{function} % -% \StopEventually{} +% \begin{function}{ \KV_add_value_element:w | \KV_set_key_element:w } +% \begin{syntax} +% "\KV_set_key_element:w" <token list> "\q_nil" +% "\KV_add_value_element:w" "\q_stop" <token list> "\q_nil" +% \end{syntax} +% Specialised functions to strip spaces from their input and set the +% token registers "\l_KV_currkey_toks" or "\l_KV_currval_toks" +% respectively. +% \end{function} % -% \section{Implementation} +% \begin{function}{ \KV_split_key_value_current:w | +% \KV_split_key_value_space_removal:w | +% \KV_split_key_value_space_removal_detect_error:wTF | +% \KV_split_key_value_no_space_removal:w } +% \begin{syntax} +% "\KV_split_key_value_current:w" \dots +% \end{syntax} +% These functions split keyval lists into chunks depending which +% sanitising method is being used. "\KV_split_key_value_current:w" is "\cs_set_eq:NN" +% to whichever is appropriate. +% \end{function} % +% \subsection{Module code} % % We start by ensuring that the required packages are loaded. % \begin{macrocode} %<*package> \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{l3quark} -\RequirePackage{l3toks} -\RequirePackage{l3int} -\RequirePackage{l3token} +\package_check_loaded_expl: %</package> %<*initex|package> % \end{macrocode} % % -% -% -% \begin{macro}{\l_KV_tmpa_tlp} -% \begin{macro}{\l_KV_tmpb_tlp} -% \begin{macro}{\c_KV_single_equal_sign_tlp} +% \begin{macro}{\l_KV_tmpa_tl} +% \begin{macro}{\l_KV_tmpb_tl} +% \begin{macro}{\c_KV_single_equal_sign_tl} % Various useful things. % \begin{macrocode} -\tlp_new:Nn\l_KV_tmpa_tlp{} -\tlp_new:Nn\l_KV_tmpb_tlp{} -\tlp_new:Nn \c_KV_single_equal_sign_tlp{=} +\tl_new:N \l_KV_tmpa_tl +\tl_new:N \l_KV_tmpb_tl +\tl_new:Nn \c_KV_single_equal_sign_tl{=} % \end{macrocode} % \end{macro} % \end{macro} @@ -240,12 +287,12 @@ \char_set_catcode:nn{`\,}{13} \char_set_lccode:nn{`\8}{`\=} \char_set_lccode:nn{`\9}{`\,} -\tlist_to_lowercase:n{\group_end: -\def_new:Npn \KV_sanitize_outerlevel_active_equals:N #1{ - \tlp_replace_all_in:Nnn #1 = 8 +\tl_to_lowercase:n{\group_end: +\cs_new_nopar:Npn \KV_sanitize_outerlevel_active_equals:N #1{ + \tl_replace_all_in:Nnn #1 = 8 } -\def_new:Npn \KV_sanitize_outerlevel_active_commas:N #1{ - \tlp_replace_all_in:Nnn #1 , 9 +\cs_new_nopar:Npn \KV_sanitize_outerlevel_active_commas:N #1{ + \tl_replace_all_in:Nnn #1 , 9 } } % \end{macrocode} @@ -258,10 +305,10 @@ % % \begin{macro}{\KV_remove_surrounding_spaces:nw} % \begin{macro}{\KV_remove_surrounding_spaces_auxi:w} -% \begin{macro}{\KV_remove_surrounding_spaces_auxii:w} +% \begin{macro}[aux]{\KV_remove_surrounding_spaces_auxii:w} % \begin{macro}{\KV_set_key_element:w} -% \begin{macro}{\KV_set_value_element:w} -% The macro |\KV_remove_surrounding_spaces:Nw| removes a possible +% \begin{macro}{\KV_add_value_element:w} +% The macro |\KV_remove_surrounding_spaces:nw| removes a possible % leading space plus a possible ending space from its second % argument and stores it in the token register |#1|. % @@ -274,7 +321,7 @@ \char_set_catcode:nn{`\Q}{3} % \end{macrocode} % \begin{macrocode} -\gdef_long_new:Npn\KV_remove_surrounding_spaces:nw#1#2\q_nil{ +\cs_gnew:Npn\KV_remove_surrounding_spaces:nw#1#2\q_nil{ % \end{macrocode} % The idea in this processing is to use a Q with strange catcode to % remove a trailing space. But first, how to get this expansion going? @@ -312,7 +359,7 @@ % |\KV_remove_surrounding_spaces_auxii:w| to work properly we need to % put back a Q first. % \begin{macrocode} -\gdef_long_new:Npn\KV_remove_surrounding_spaces_auxi:w#1~Q{ +\cs_gnew:Npn\KV_remove_surrounding_spaces_auxi:w#1~Q{ \KV_remove_surrounding_spaces_auxii:w #1 Q } % \end{macrocode} @@ -320,39 +367,41 @@ % taken care of by the function used to initiate the expansion. Simply % return the argument before the funny Q. % \begin{macrocode} -\gdef_long_new:Npn\KV_remove_surrounding_spaces_auxii:w#1Q#2{#1} +\cs_gnew:Npn\KV_remove_surrounding_spaces_auxii:w#1Q#2{#1} % \end{macrocode} +% % Here are some specialized versions of the above. They do exactly % what we want in one go. First trim spaces from the value and then % put the result surrounded in braces onto |\l_KV_parse_toks|. % \begin{macrocode} -\gdef_long_new:Npn\KV_add_value_element:w\q_stop#1\q_nil{ +\cs_gnew:Npn\KV_add_value_element:w\q_stop#1\q_nil{ \toks_set:Nf\l_KV_currval_toks { \KV_remove_surrounding_spaces_auxi:w \exp_not:N#1Q~Q } \toks_put_right:No\l_KV_parse_toks{ - \exp_after:NN {\toks_use:N \l_KV_currval_toks} + \exp_after:wN {\toks_use:N \l_KV_currval_toks} } } % \end{macrocode} % When storing the key we firstly remove spaces plus the prepended % |\q_no_value|. % \begin{macrocode} -\gdef_long_new:Npn\KV_set_key_element:w#1\q_nil{ +\cs_gnew:Npn\KV_set_key_element:w#1\q_nil{ \toks_set:Nf\l_KV_currkey_toks { - \exp_after:NN\KV_remove_surrounding_spaces_auxi:w - \exp_after:NN\exp_not:N\use_none:n #1Q~Q + \exp_last_unbraced:NNo \KV_remove_surrounding_spaces_auxi:w + \exp_not:N \use_none:n #1Q~Q } % \end{macrocode} % Afterwards we gobble an extra level of braces if that's what we are -% asked to do. +% asked to do. The next part can be done using \cs{toks_set:Nd}, but +% this might not be around for long. % \begin{macrocode} \bool_if:NT \l_KV_remove_one_level_of_braces_bool { - \toks_set:Nd \l_KV_currkey_toks{ - \exp_after:NN \KV_add_element_aux:w - \toks_use:N \l_KV_currkey_toks \q_nil + \exp_args:NNo \toks_set:No \l_KV_currkey_toks { + \exp_after:wN \KV_add_element_aux:w + \toks_use:N \l_KV_currkey_toks \q_nil } } } @@ -364,10 +413,10 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\KV_add_element_aux:w} +% \begin{macro}[aux]{\KV_add_element_aux:w} % A helper function for fixing braces around keys and values. % \begin{macrocode} -\def_long_new:Npn \KV_add_element_aux:w#1\q_nil{#1} +\cs_new:Npn \KV_add_element_aux:w#1\q_nil{#1} % \end{macrocode} % \end{macro} % @@ -375,57 +424,58 @@ % Parse a list of keyvals, put them into list form with entries like % |\KV_key_no_value_elt:n{key1}| and |\KV_key_value_elt:nn{key2}{val2}|. % -% \begin{macro}{\KV_parse_sanitize_aux:n} +% \begin{macro}[aux]{\KV_parse_sanitize_aux:n} % The slow parsing algorithm sanitizes active commas and equal signs % at the top level first. Then uses |#1| as inspector of each % element in the comma list. % \begin{macrocode} -\def_long_new:Npn \KV_parse_sanitize_aux:n #1{ +\cs_new:Npn \KV_parse_sanitize_aux:n #1 { \group_begin: - \toks_clear:N \l_KV_parse_toks - \tlp_set:Nx\l_KV_tmpa_tlp{\exp_not:n{#1}} - \KV_sanitize_outerlevel_active_equals:N\l_KV_tmpa_tlp - \KV_sanitize_outerlevel_active_commas:N\l_KV_tmpa_tlp - \exp_after:NN \KV_parse_elt:w \exp_after:NN\q_no_value \l_KV_tmpa_tlp,\q_nil, + \toks_clear:N \l_KV_parse_toks + \tl_set:Nx \l_KV_tmpa_tl { \exp_not:n {#1} } + \KV_sanitize_outerlevel_active_equals:N \l_KV_tmpa_tl + \KV_sanitize_outerlevel_active_commas:N \l_KV_tmpa_tl + \exp_last_unbraced:NNV \KV_parse_elt:w \q_no_value + \l_KV_tmpa_tl , \q_nil , % \end{macrocode} % We evaluate the parsed keys and values outside the group so the % token register is restored to its previous value. % \begin{macrocode} - \exp_after:NN\group_end: - \toks_use:N \l_KV_parse_toks + \exp_last_unbraced:NV \group_end: + \l_KV_parse_toks } % \end{macrocode} % \end{macro} % % -% \begin{macro}{\KV_parse_no_sanitize_aux:n} +% \begin{macro}[aux]{\KV_parse_no_sanitize_aux:n} % Like above but we don't waste time sanitizing. This is probably % the one we will use for preamble parsing where catcodes of |=| and % |,| are as expected! % \begin{macrocode} -\def_long_new:Npn \KV_parse_no_sanitize_aux:n #1{ +\cs_new:Npn \KV_parse_no_sanitize_aux:n #1{ \group_begin: - \toks_clear:N \l_KV_parse_toks - \KV_parse_elt:w \q_no_value #1,\q_nil, - \exp_after:NN\group_end: - \toks_use:N \l_KV_parse_toks + \toks_clear:N \l_KV_parse_toks + \KV_parse_elt:w \q_no_value #1 , \q_nil , + \exp_last_unbraced:NV \group_end: + \l_KV_parse_toks } % \end{macrocode} % \end{macro} % % -% \begin{macro}{\KV_parse_elt:w} +% \begin{macro}[aux]{\KV_parse_elt:w} % This function will always have a |\q_no_value| stuffed in as the % rightmost token in |#1|. In case there was a blank entry in the % comma separated list we just run it again. The |\use_none:n| makes % sure to gobble the quark |\q_no_value|. A similar test is made to % check if we hit the end of the recursion. % \begin{macrocode} -\def_long:Npn \KV_parse_elt:w #1,{ - \tlist_if_blank:oTF{\use_none:n #1} +\cs_set:Npn \KV_parse_elt:w #1,{ + \tl_if_blank:oTF{\use_none:n #1} { \KV_parse_elt:w \q_no_value } { - \quark_if_nil:oF {\use_arg_ii:nn #1 } + \quark_if_nil:oF {\use_ii:nn #1 } % \end{macrocode} % If we made it to here we can start parsing the key and value. When % done try, try again. @@ -443,7 +493,7 @@ % \begin{macro}{\KV_split_key_value_current:w} % The function called to split the keys and values. % \begin{macrocode} -\let_new:NN \KV_split_key_value_current:w \ERROR +\cs_new:Npn \KV_split_key_value_current:w {\ERROR} % \end{macrocode} % \end{macro} % @@ -462,7 +512,7 @@ % % \begin{macro}{\KV_split_key_value_space_removal:w} % \begin{macro}{\KV_split_key_value_space_removal_detect_error:wTF} -% \begin{macro}{\KV_split_key_value_space_removal_aux:w} +% \begin{macro}[aux]{\KV_split_key_value_space_removal_aux:w} % The code below removes extraneous spaces around the keys and % values plus one set of braces around the entire value. % @@ -474,7 +524,7 @@ % this is slightly more tedious (but only slightly) but at least it % always removes only one level of braces. % \begin{macrocode} -\def_long_new:Npn \KV_split_key_value_space_removal:w #1 = #2\q_nil{ +\cs_new:Npn \KV_split_key_value_space_removal:w #1 = #2\q_nil{ % \end{macrocode} % First grab the key. % \begin{macrocode} @@ -483,15 +533,15 @@ % Then we start checking. If only a key was entered, |#2| contains % |=| and nothing else, so we test for that first. % \begin{macrocode} - \tlp_set:Nx\l_KV_tmpa_tlp{\exp_not:n{#2}} - \tlp_if_eq:NNTF\l_KV_tmpa_tlp\c_KV_single_equal_sign_tlp + \tl_set:Nx\l_KV_tmpa_tl{\exp_not:n{#2}} + \tl_if_eq:NNTF\l_KV_tmpa_tl\c_KV_single_equal_sign_tl % \end{macrocode} % Then we just insert the default key. % \begin{macrocode} { \toks_put_right:No\l_KV_parse_toks{ - \exp_after:NN \KV_key_no_value_elt:n - \exp_after:NN {\toks_use:N\l_KV_currkey_toks} + \exp_after:wN \KV_key_no_value_elt:n + \exp_after:wN {\toks_use:N\l_KV_currkey_toks} } } % \end{macrocode} @@ -510,9 +560,9 @@ % \end{macrocode} % The error test. % \begin{macrocode} -\def_long_new:Npn +\cs_new:Npn \KV_split_key_value_space_removal_detect_error:wTF#1=#2#3\q_nil{ - \tlist_if_head_eq_meaning:nNTF{#3}\q_no_value + \tl_if_head_eq_meaning:nNTF{#3}\q_no_value } % \end{macrocode} % Now we can start extracting the value. Recall that |#1| here starts @@ -521,18 +571,18 @@ % is empty or blank, all three quarks are gobbled. If |#1| consists of % exactly one token or brace group, only the latter quark is left. % \begin{macrocode} -\def_long_new:Npn \KV_val_preserve_braces:NnN #1#2#3{{#2}} -\def_long_new:Npn\KV_split_key_value_space_removal_aux:w #1=={ - \tlp_set:Nx\l_KV_tmpa_tlp{\exp_not:o{\use_none:nnn#1\q_nil\q_nil}} +\cs_new:Npn \KV_val_preserve_braces:NnN #1#2#3{{#2}} +\cs_new:Npn\KV_split_key_value_space_removal_aux:w #1=={ + \tl_set:Nx\l_KV_tmpa_tl{\exp_not:o{\use_none:nnn#1\q_nil\q_nil}} \toks_put_right:No\l_KV_parse_toks{ - \exp_after:NN \KV_key_value_elt:nn - \exp_after:NN {\toks_use:N\l_KV_currkey_toks} + \exp_after:wN \KV_key_value_elt:nn + \exp_after:wN {\toks_use:N\l_KV_currkey_toks} } % \end{macrocode} -% If there a blank space or nothing at all, |\l_KV_tmpa_tlp| is now +% If there a blank space or nothing at all, |\l_KV_tmpa_tl| is now % completely empty. % \begin{macrocode} - \tlp_if_empty:NTF\l_KV_tmpa_tlp + \tl_if_empty:NTF\l_KV_tmpa_tl % \end{macrocode} % We just put an empty value on the stack. % \begin{macrocode} @@ -540,21 +590,21 @@ { % \end{macrocode} % If there was exactly one brace group or token in |#1|, -% |\l_KV_tmpa_tlp| is now equal to |\q_nil|. Then we can just pick it +% |\l_KV_tmpa_tl| is now equal to |\q_nil|. Then we can just pick it % up as the second argument of |#1|. This will also take care of any % spaces which might surround it. % \begin{macrocode} - \quark_if_nil:NTF\l_KV_tmpa_tlp + \quark_if_nil:NTF\l_KV_tmpa_tl { \bool_if:NTF \l_KV_remove_one_level_of_braces_bool { \toks_put_right:No\l_KV_parse_toks{ - \exp_after:NN{\use_arg_ii:nnn #1\q_nil} + \exp_after:wN{\use_ii:nnn #1\q_nil} } } { \toks_put_right:No\l_KV_parse_toks{ - \exp_after:NN{\KV_val_preserve_braces:NnN #1\q_nil} + \exp_after:wN{\KV_val_preserve_braces:NnN #1\q_nil} } } } @@ -575,14 +625,14 @@ % however fun they may be. Since there are no spaces, a set of % braces around a value is automatically stripped by \TeX. % \begin{macrocode} -\def_long_new:Npn \KV_split_key_value_no_space_removal:w #1#2=#3=#4\q_nil{ - \tlp_set:Nn\l_KV_tmpa_tlp{#4} - \tlp_if_empty:NTF \l_KV_tmpa_tlp +\cs_new:Npn \KV_split_key_value_no_space_removal:w #1#2=#3=#4\q_nil{ + \tl_set:Nn\l_KV_tmpa_tl{#4} + \tl_if_empty:NTF \l_KV_tmpa_tl { \toks_put_right:Nn\l_KV_parse_toks{\KV_key_no_value_elt:n{#2}} } { - \tlp_if_eq:NNTF\c_KV_single_equal_sign_tlp\l_KV_tmpa_tlp + \tl_if_eq:NNTF\c_KV_single_equal_sign_tl\l_KV_tmpa_tl { \toks_put_right:Nn\l_KV_parse_toks{\KV_key_value_elt:nn{#2}{#3}} } @@ -597,8 +647,8 @@ % \begin{macro}{\KV_key_no_value_elt:n} % \begin{macro}{\KV_key_value_elt:nn} % \begin{macrocode} -\def_long_new:Npn \KV_key_no_value_elt:n #1{\ERROR} -\def_long_new:Npn \KV_key_value_elt:nn #1#2{\ERROR} +\cs_new:Npn \KV_key_no_value_elt:n #1{\ERROR} +\cs_new:Npn \KV_key_value_elt:nn #1#2{\ERROR} % \end{macrocode} % \end{macro} % \end{macro} @@ -612,8 +662,8 @@ % version that disallows unmatched conditional and does no space % removal. % \begin{macrocode} -\def_new:Npn \KV_parse_no_space_removal_no_sanitize:n { - \let:NN \KV_split_key_value_current:w \KV_split_key_value_no_space_removal:w +\cs_new_nopar:Npn \KV_parse_no_space_removal_no_sanitize:n { + \cs_set_eq:NN \KV_split_key_value_current:w \KV_split_key_value_no_space_removal:w \KV_parse_no_sanitize_aux:n } % \end{macrocode} @@ -624,15 +674,15 @@ % The other varieties can be defined in a similar manner. For the % version needed at the document level, we can use this one. % \begin{macrocode} -\def_new:Npn \KV_parse_space_removal_sanitize:n { - \let:NN \KV_split_key_value_current:w \KV_split_key_value_space_removal:w +\cs_new_nopar:Npn \KV_parse_space_removal_sanitize:n { + \cs_set_eq:NN \KV_split_key_value_current:w \KV_split_key_value_space_removal:w \KV_parse_sanitize_aux:n } % \end{macrocode} % For preamble use by the non-programmer this is probably best. % \begin{macrocode} -\def_new:Npn \KV_parse_space_removal_no_sanitize:n { - \let:NN \KV_split_key_value_current:w \KV_split_key_value_space_removal:w +\cs_new_nopar:Npn \KV_parse_space_removal_no_sanitize:n { + \cs_set_eq:NN \KV_split_key_value_current:w \KV_split_key_value_space_removal:w \KV_parse_no_sanitize_aux:n } % \end{macrocode} @@ -642,24 +692,15 @@ % % \begin{macrocode} %</initex|package> +% \end{macrocode} +% +% \begin{macrocode} %<*showmemory> \showMemUsage %</showmemory> % \end{macrocode} % -% \endinput -% -% $Log$ -% Revision 1.4 2006/07/25 22:38:58 morten -% Removed spurious \exp_after:NN in \KV_add_value_element:w. Sigh. -% -% Revision 1.3 2006/07/25 22:34:03 morten -% Fixed silly bug in \KV_set_key_element:w plus clean-up of code -% -% Revision 1.2 2006/07/25 16:21:30 morten -% Allow values to contain unmatched conditionals such as `val -% \fi:'. Provide option to not strip any braces at all. -% -% Revision 1.1 2006/01/27 10:14:24 morten -% Initial version of keyval parser +% \end{implementation} +% \PrintIndex % +% \endinput |