Skip to content

Commit

Permalink
Naming updates
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Mar 4, 2022
1 parent 507f462 commit df7cadd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion l3kernel/CHANGELOG.md
Expand Up @@ -8,7 +8,7 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]

### Added
- `\keys_digiest:nnN` for conversion of keyvals to fast-to-apply token
- `\keys_precompile:Nnn` for conversion of keyvals to fast-to-apply token
lists

## [2022-02-24]
Expand Down
34 changes: 17 additions & 17 deletions l3kernel/l3keys.dtx
Expand Up @@ -884,13 +884,13 @@
%
% \section{Digesting keys}
%
% \begin{function}[added = 2022-02-28]{\keys_digest:nnN}
% \begin{function}[added = 2022-03-04]{\keys_precompile:Nnn}
% \begin{syntax}
% \cs{keys_digest:nnN} \Arg{module} \Arg{keyval list} \meta{tl}
% \cs{keys_precompile:Nnn} \meta{tl} \Arg{module} \Arg{keyval list}
% \end{syntax}
% Parses the \meta{keyval list} as for \cs{keys_set:nn}, placing the
% resulting code for those which set variables or functions into the
% \meta{tl}. Thus this function \enquote{digests} the keyval list into
% \meta{tl}. Thus this function \enquote{precompiles} the keyval list into
% a set of results which can be applied rapidly.
% \end{function}
%
Expand Down Expand Up @@ -1673,11 +1673,11 @@
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\l_@@_digest_bool, \l_@@_digest_tl}
% \begin{variable}{\l_@@_precompile_bool, \l_@@_precompile_tl}
% For digesting keys.
% \begin{macrocode}
\bool_new:N \l_@@_digest_bool
\tl_new:N \l_@@_digest_tl
\bool_new:N \l_@@_precompile_bool
\tl_new:N \l_@@_precompile_tl
% \end{macrocode}
% \end{variable}
%
Expand Down Expand Up @@ -1983,8 +1983,8 @@
{
\@@_cmd_set_direct:nn {#1}
{
\bool_if:NTF \l_@@_digest_bool
{ \tl_put_right:Nn \l_@@_digest_tl }
\bool_if:NTF \l_@@_precompile_bool
{ \tl_put_right:Nn \l_@@_precompile_tl }
{ \use:n }
{#2}
}
Expand All @@ -2004,8 +2004,8 @@
{
\cs_set_protected:cpx { \c_@@_code_root_str \l_keys_path_str } ##1
{
\exp_not:N \bool_if:NTF \exp_not:N \l_@@_digest_bool
{ \tl_put_right:Nn \exp_not:N \l_@@_digest_tl }
\exp_not:N \bool_if:NTF \exp_not:N \l_@@_precompile_bool
{ \tl_put_right:Nn \exp_not:N \l_@@_precompile_tl }
{ \exp_not:N \use:n }
{ #1 \exp_not:N #2 \exp_not:n {#3} {##1} }
}
Expand Down Expand Up @@ -2937,16 +2937,16 @@
% \end{macro}
% \end{macro}
%
% \begin{macro}{\keys_digest:nnN}
% \begin{macro}{\keys_precompile:Nnn}
% A simple wrapper.
% \begin{macrocode}
\cs_new_protected:Npn \keys_digest:nnN #1#2#3
\cs_new_protected:Npn \keys_precompile:Nnn #1#2#3
{
\bool_set_true:N \l_@@_digest_bool
\tl_clear:N \l_@@_digest_tl
\keys_set:nn {#1} {#2}
\bool_set_false:N \l_@@_digest_bool
\tl_set_eq:NN #3 \l_@@_digest_tl
\bool_set_true:N \l_@@_precompile_bool
\tl_clear:N \l_@@_precompile_tl
\keys_set:nn {#2} {#3}
\bool_set_false:N \l_@@_precompile_bool
\tl_set_eq:NN #1 \l_@@_precompile_tl
}
% \end{macrocode}
% \end{macro}
Expand Down
21 changes: 12 additions & 9 deletions l3kernel/testfiles/m3keys008.lvt
Expand Up @@ -15,7 +15,7 @@
\AUTHOR{Joseph Wright}
\ExplSyntaxOn

\TEST { Key~digestion~of~settings }
\TEST { Key~precompilation~of~settings }
{
\OMIT
\keys_define:nn { test }
Expand All @@ -34,7 +34,9 @@
key-twelve .tl_set_x:N = \l_tmpb_tl
}
\TIMO
\keys_digest:nnN { test }
\keys_precompile:Nnn
\l_tmpa_tl
{ test }
{
key-one = true ,
key-two = { a , b } ,
Expand All @@ -49,11 +51,10 @@
key-eleven = footoo ,
key-twelve = \l_tmpa_tl
}
\l_tmpa_tl
\tl_show:N \l_tmpa_tl
}

\TEST { Digesting~choices }
\TEST { Precompiling~choices }
{
\OMIT
\keys_define:nn { test }
Expand All @@ -73,17 +74,18 @@
{#1}
}
\TIMO
\keys_digest:nnN { test }
\keys_precompile:Nnn
\l_tmpa_tl
{ test }
{
key-one = choice-one , key-one = choice-three ,
key-two = choice-one , key-two = choice-three ,
key-three = choice-one , key-three = choice-three
}
\l_tmpa_tl
\tl_show:N \l_tmpa_tl
}

\TEST { Digesting~meta~keys }
\TEST { Precompiling~meta~keys }
{
\OMIT
\keys_define:nn { test }
Expand All @@ -92,11 +94,12 @@
key-two .meta:n = {key-one = "#1"}
}
\TIMO
\keys_digest:nnN { test }
\keys_precompile:Nnn
\l_tmpa_tl
{ test }
{
key-one = AAA, key-two = BBB
}
\l_tmpa_tl
\tl_show:N \l_tmpa_tl
}

Expand Down
6 changes: 3 additions & 3 deletions l3kernel/testfiles/m3keys008.tlg
Expand Up @@ -2,7 +2,7 @@ This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
Author: Joseph Wright
============================================================
TEST 1: Key digestion of settings
TEST 1: Key precompilation of settings
============================================================
> \l_tmpa_tl=\bool_set_false:N \l_tmpa_bool \clist_set:Nn \l_tmpa_clist
{a,b}foo\cs_set:Npn \foo ##1##2{##1:##2}\dim_set:Nn \l_tmpa_dim
Expand All @@ -14,7 +14,7 @@ TEST 1: Key digestion of settings
l. ... }
============================================================
============================================================
TEST 2: Digesting choices
TEST 2: Precompiling choices
============================================================
> \l_tmpa_tl=AAAACCCCAAAACCCC\tl_set:Nn \l_keys_choice_tl
{choice-one}\int_set:Nn \l_keys_choice_int {1}choice-one\tl_set:Nn
Expand All @@ -24,7 +24,7 @@ TEST 2: Digesting choices
l. ... }
============================================================
============================================================
TEST 3: Digesting meta keys
TEST 3: Precompiling meta keys
============================================================
> \l_tmpa_tl=AAA"BBB".
<recently read> }
Expand Down

0 comments on commit df7cadd

Please sign in to comment.