[latex3-commits] [git/latex3] master: Add l3candidates \prop_const_from_keyval:Nn (see #257) (2dfdd63)

Bruno Le Floch bruno at le-floch.fr
Wed Nov 29 04:50:13 CET 2017


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/2dfdd6366875257b3049ed923a95732b6c09eedd

>---------------------------------------------------------------

commit 2dfdd6366875257b3049ed923a95732b6c09eedd
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Tue Nov 28 22:50:13 2017 -0500

    Add l3candidates \prop_const_from_keyval:Nn (see #257)


>---------------------------------------------------------------

2dfdd6366875257b3049ed923a95732b6c09eedd
 l3kernel/l3candidates.dtx               |   30 ++++++++
 l3kernel/l3coffins.dtx                  |   45 ++++++------
 l3kernel/l3msg.dtx                      |    2 +
 l3kernel/l3prop.dtx                     |   79 +++++++++++++++++++++
 l3kernel/testfiles/m3expl001.luatex.tlg |   12 ++++
 l3kernel/testfiles/m3expl001.ptex.tlg   |   12 ++++
 l3kernel/testfiles/m3expl001.tlg        |   12 ++++
 l3kernel/testfiles/m3expl001.uptex.tlg  |   12 ++++
 l3kernel/testfiles/m3expl001.xetex.tlg  |   12 ++++
 l3kernel/testfiles/m3expl003.luatex.tlg |   12 ++++
 l3kernel/testfiles/m3expl003.ptex.tlg   |   12 ++++
 l3kernel/testfiles/m3expl003.tlg        |   12 ++++
 l3kernel/testfiles/m3expl003.uptex.tlg  |   12 ++++
 l3kernel/testfiles/m3expl003.xetex.tlg  |   12 ++++
 l3kernel/testfiles/m3prop005.lvt        |   46 ++++++++++++
 l3kernel/testfiles/m3prop005.tlg        |  118 +++++++++++++++++++++++++++++++
 16 files changed, 416 insertions(+), 24 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index a5f0a27..3bc1c17 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -415,6 +415,36 @@
 %   \end{texnote}
 % \end{function}
 %
+% \begin{function}[added = 2017-11-28]
+%   {
+%     \prop_set_from_keyval:Nn, \prop_set_from_keyval:cn,
+%     \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn,
+%   }
+%   \begin{syntax}
+%     \cs{prop_set_from_keyval:Nn} \meta{prop~var}
+%       \{
+%         \meta{key1} |=| \meta{value1} |,|
+%         \meta{key2} |=| \meta{value2} |,| \ldots{}
+%       \}
+%   \end{syntax}
+%   Sets \meta{prop~var} to contain key--value pairs given in the second
+%   argument.
+% \end{function}
+%
+% \begin{function}[added = 2017-11-28]
+%   {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn}
+%   \begin{syntax}
+%     \cs{prop_const_from_keyval:Nn} \meta{prop~var}
+%       \{
+%         \meta{key1} |=| \meta{value1} |,|
+%         \meta{key2} |=| \meta{value2} |,| \ldots{}
+%       \}
+%   \end{syntax}
+%   Creates a new constant \meta{prop~var} or raises an error if the
+%   name is already taken. The \meta{prop~var} is set globally to
+%   contain key--value pairs given in the second argument.
+% \end{function}
+%
 % \section{Additions to \pkg{l3seq}}
 %
 % \begin{function}[rEXP]
diff --git a/l3kernel/l3coffins.dtx b/l3kernel/l3coffins.dtx
index 929ced5..7d42714 100644
--- a/l3kernel/l3coffins.dtx
+++ b/l3kernel/l3coffins.dtx
@@ -356,37 +356,34 @@
 % \begin{variable}{\c_@@_corners_prop}
 %   The \enquote{corners}; of a coffin define the real content, as
 %   opposed to the \TeX{} bounding box. They all start off in the same
-%   place, of course.  The \cs{debug_suspend:} and \cs{debug_resume:}
-%   are needed because we are assigning to a constant variable.
+%   place, of course.
 %    \begin{macrocode}
-\prop_new:N \c_@@_corners_prop
-\debug_suspend:
-\prop_put:Nnn \c_@@_corners_prop { tl } { { 0pt } { 0pt } }
-\prop_put:Nnn \c_@@_corners_prop { tr } { { 0pt } { 0pt } }
-\prop_put:Nnn \c_@@_corners_prop { bl } { { 0pt } { 0pt } }
-\prop_put:Nnn \c_@@_corners_prop { br } { { 0pt } { 0pt } }
-\debug_resume:
+\prop_const_from_keyval:Nn \c_@@_corners_prop
+  {
+    tl = { 0pt } { 0pt } ,
+    tr = { 0pt } { 0pt } ,
+    bl = { 0pt } { 0pt } ,
+    br = { 0pt } { 0pt } ,
+  }
 %    \end{macrocode}
 % \end{variable}
 %
 % \begin{variable}{\c_@@_poles_prop}
 %   Pole positions are given for horizontal, vertical and reference-point
-%   based values.  Again, need \cs{debug_suspend:} and \cs{debug_resume:}.
+%   based values.
 %    \begin{macrocode}
-\prop_new:N \c_@@_poles_prop
-\debug_suspend:
-\tl_set:Nn \l_@@_internal_tl { { 0pt } { 0pt } { 0pt } { 1000pt } }
-\prop_put:Nno \c_@@_poles_prop { l }  { \l_@@_internal_tl }
-\prop_put:Nno \c_@@_poles_prop { hc } { \l_@@_internal_tl }
-\prop_put:Nno \c_@@_poles_prop { r }  { \l_@@_internal_tl }
-\tl_set:Nn \l_@@_internal_tl { { 0pt } { 0pt } { 1000pt } { 0pt } }
-\prop_put:Nno \c_@@_poles_prop { b }  { \l_@@_internal_tl }
-\prop_put:Nno \c_@@_poles_prop { vc } { \l_@@_internal_tl }
-\prop_put:Nno \c_@@_poles_prop { t }  { \l_@@_internal_tl }
-\prop_put:Nno \c_@@_poles_prop { B }  { \l_@@_internal_tl }
-\prop_put:Nno \c_@@_poles_prop { H }  { \l_@@_internal_tl }
-\prop_put:Nno \c_@@_poles_prop { T }  { \l_@@_internal_tl }
-\debug_resume:
+\prop_const_from_keyval:Nn \c_@@_poles_prop
+  {
+    l  = { 0pt } { 0pt } { 0pt } { 1000pt } ,
+    hc = { 0pt } { 0pt } { 0pt } { 1000pt } ,
+    r  = { 0pt } { 0pt } { 0pt } { 1000pt } ,
+    b  = { 0pt } { 0pt } { 1000pt } { 0pt } ,
+    vc = { 0pt } { 0pt } { 1000pt } { 0pt } ,
+    t  = { 0pt } { 0pt } { 1000pt } { 0pt } ,
+    B  = { 0pt } { 0pt } { 1000pt } { 0pt } ,
+    H  = { 0pt } { 0pt } { 1000pt } { 0pt } ,
+    T  = { 0pt } { 0pt } { 1000pt } { 0pt } ,
+  }
 %    \end{macrocode}
 % \end{variable}
 %
diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index ec4d48b..795816e 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -2018,6 +2018,8 @@
   { A~property~list~was~misused. }
 \@@_kernel_new:nnn { kernel } { negative-replication }
   { Negative~argument~for~\prg_replicate:nn. }
+\@@_kernel_new:nnn { kernel } { prop-keyval }
+  { Missing/extra~'='~in~'#1'~(in~'..._keyval:Nn') }
 \@@_kernel_new:nnn { kernel } { unknown-comparison }
   { Relation~'#1'~unknown:~use~=,~<,~>,~==,~!=,~<=,~>=. }
 \@@_kernel_new:nnn { kernel } { zero-step }
diff --git a/l3kernel/l3prop.dtx b/l3kernel/l3prop.dtx
index 09b37b7..5aa3413 100644
--- a/l3kernel/l3prop.dtx
+++ b/l3kernel/l3prop.dtx
@@ -626,6 +626,85 @@
 % \end{variable}
 % \end{variable}
 %
+% \begin{macro}{\prop_set_from_keyval:Nn, \prop_set_from_keyval:cn}
+% \begin{macro}{\prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn}
+% \begin{macro}{\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn}
+% \begin{macro}[aux]
+%   {
+%     \@@_from_keyval:n,
+%     \@@_from_keyval_loop:w,
+%     \@@_from_keyval_split:Nw,
+%     \@@_from_keyval_key:w,
+%     \@@_from_keyval_value:w
+%   }
+%   Loop through items separated by commas, with \cs{q_mark} to avoid
+%   losing braces.  After checking for termination, split the item at
+%   the first then at the second |=| (which ought to be the first of the
+%   trailing~|=|).  At both splits, trim spaces (the internal
+%   \cs{__tl_trim_spaces:nn} expects the \cs{q_mark} we give it) and
+%   call \cs{@@_from_keyval_key:w}, then \cs{@@_from_keyval_value:w},
+%   followed by the trimmed material, \cs{q_nil}, the subsequent part of
+%   the item, and the trailing |=|'s and \cs{q_stop}.  After finding the
+%   \meta{key} just store it after \cs{q_stop}.  After finding the
+%   \meta{value} ignore completely empty items (both trailing~|=| were
+%   used as delimiters and all parts are empty); if the remaining
+%   part~|#2| consists exactly of the second trailing~|=| (namely there
+%   was exactly one |=|~in the item) then output one key--value pair for
+%   the property list; otherwise complain about a missing or extra~|=|.
+%    \begin{macrocode}
+\cs_new_protected:Npn \prop_set_from_keyval:Nn #1#2
+  { \tl_set:Nx #1 { \@@_from_keyval:n {#2} } }
+\cs_generate_variant:Nn \prop_set_from_keyval:Nn { c }
+\cs_new_protected:Npn \prop_gset_from_keyval:Nn #1#2
+  { \tl_gset:Nx #1 { \@@_from_keyval:n {#2} } }
+\cs_generate_variant:Nn \prop_gset_from_keyval:Nn { c }
+\cs_new_protected:Npn \prop_const_from_keyval:Nn #1#2
+  { \tl_const:Nx #1 { \@@_from_keyval:n {#2} } }
+\cs_generate_variant:Nn \prop_const_from_keyval:Nn { c }
+\cs_new:Npn \@@_from_keyval:n #1
+  {
+    \s_@@
+    \@@_from_keyval_loop:w \q_mark #1 ,
+      \q_recursion_tail , \q_recursion_stop
+  }
+\cs_new:Npn \@@_from_keyval_loop:w #1 ,
+  {
+    \quark_if_recursion_tail_stop:o { \use_none:n #1 }
+    \@@_from_keyval_split:Nw \@@_from_keyval_key:w
+      #1 = = \q_stop { \use_none:n #1 }
+    \@@_from_keyval_loop:w \q_mark
+  }
+\cs_new:Npn \@@_from_keyval_split:Nw #1#2 =
+  {
+    \__tl_trim_spaces:nn {#2}
+      { \exp_last_unbraced:No #1 } \q_nil
+  }
+\cs_new:Npn \@@_from_keyval_key:w #1 \q_nil #2 \q_stop
+  {
+    \@@_from_keyval_split:Nw \@@_from_keyval_value:w
+      \q_mark #2 \q_stop {#1}
+  }
+\cs_new:Npn \@@_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4
+  {
+    \tl_if_empty:nF { #3 #1 #2 }
+      {
+        \str_if_eq:nnTF {#2} { = }
+          {
+            \exp_not:N \@@_pair:wn \tl_to_str:n {#3}
+            \s_@@ { \exp_not:n {#1} }
+          }
+          {
+            \exp_args:Nnno \__msg_kernel_expandable_error:nnn
+              { kernel } { prop-keyval } {#4}
+          }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
 % \subsection{Accessing data in property lists}
 %
 % \begin{macro}[int]{\@@_split:NnTF}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index a09b2c2..5694611 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2512,6 +2512,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2871,6 +2882,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 90599c3..6778ac8 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -2500,6 +2500,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2859,6 +2870,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 4f7fb30..082ca0e 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -2500,6 +2500,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2859,6 +2870,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 449d547..dc00bf4 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -2500,6 +2500,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2859,6 +2870,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index d0182b8..1314e0c 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2510,6 +2510,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2869,6 +2880,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index a09b2c2..5694611 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2512,6 +2512,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2871,6 +2882,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 90599c3..6778ac8 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -2500,6 +2500,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2859,6 +2870,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 4f7fb30..082ca0e 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -2500,6 +2500,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2859,6 +2870,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 449d547..dc00bf4 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -2500,6 +2500,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2859,6 +2870,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index d0182b8..1314e0c 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2510,6 +2510,17 @@ Defining \l_tmpa_prop on line ...
 Defining \l_tmpb_prop on line ...
 Defining \g_tmpa_prop on line ...
 Defining \g_tmpb_prop on line ...
+Defining \prop_set_from_keyval:Nn on line ...
+Defining \prop_set_from_keyval:cn on line ...
+Defining \prop_gset_from_keyval:Nn on line ...
+Defining \prop_gset_from_keyval:cn on line ...
+Defining \prop_const_from_keyval:Nn on line ...
+Defining \prop_const_from_keyval:cn on line ...
+Defining \__prop_from_keyval:n on line ...
+Defining \__prop_from_keyval_loop:w on line ...
+Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
 Defining \__prop_split_aux:w on line ...
@@ -2869,6 +2880,7 @@ Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...
 Defining message LaTeX/kernel/misused-prop on line ...
 Defining message LaTeX/kernel/negative-replication on line ...
+Defining message LaTeX/kernel/prop-keyval on line ...
 Defining message LaTeX/kernel/unknown-comparison on line ...
 Defining message LaTeX/kernel/zero-step on line ...
 Defining message LaTeX/kernel/show-clist on line ...
diff --git a/l3kernel/testfiles/m3prop005.lvt b/l3kernel/testfiles/m3prop005.lvt
new file mode 100644
index 0000000..d3d7238
--- /dev/null
+++ b/l3kernel/testfiles/m3prop005.lvt
@@ -0,0 +1,46 @@
+%
+% Copyright (C) 2017 The LaTeX Project
+%
+
+\documentclass{minimal}
+\input{regression-test}
+
+
+\RequirePackage[check-declarations,log-functions]{expl3}
+
+
+\begin{document}
+\START
+\AUTHOR{Bruno Le Floch}
+\ExplSyntaxOn
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\TEST { prop~from_keyval }
+  {
+    \prop_set_from_keyval:Nn \l_tmpa_prop
+      { \a = b , ~ \c ~ = ~ { ~ \d = e ~ } , , = , { = } = , ~ { } ~ = { , } , }
+    \prop_log:N \l_tmpa_prop
+    \prop_gset_from_keyval:Nn \g_tmpa_prop
+      { \a = b , ~ \c ~ = ~ { ~ \d = e ~ } , , = , { = } = , ~ { } ~ = { , } , }
+    \prop_log:N \g_tmpa_prop
+    \prop_const_from_keyval:Nn \c_A_prop
+      { \a = b , ~ \c ~ = ~ { ~ \d = e ~ } , , = , { = } = , ~ { } ~ = { , } , }
+    \prop_log:N \c_A_prop
+  }
+
+\TEST { prop~from_keyval~invalid }
+  {
+    \prop_set_from_keyval:Nn \l_tmpa_prop
+      { { = } , a = = b , { } , = = }
+    \prop_log:N \l_tmpa_prop
+    \prop_gset_from_keyval:Nn \g_tmpa_prop
+      { { = } , a = = b , { } , = = }
+    \prop_log:N \g_tmpa_prop
+    \prop_const_from_keyval:Nn \c_B_prop
+      { { = } , a = = b , { } , = = }
+    \prop_log:N \c_B_prop
+  }
+
+\END
+
diff --git a/l3kernel/testfiles/m3prop005.tlg b/l3kernel/testfiles/m3prop005.tlg
new file mode 100644
index 0000000..e9614db
--- /dev/null
+++ b/l3kernel/testfiles/m3prop005.tlg
@@ -0,0 +1,118 @@
+This is a generated file for the LaTeX (2e + expl3) validation system.
+Don't change this file in any respect.
+Author: Bruno Le Floch
+============================================================
+TEST 1: prop from_keyval
+============================================================
+The property list \l_tmpa_prop contains the pairs (without outer braces):
+>  {\a }  =>  {b}
+>  {\c }  =>  { \d =e }
+>  {}  =>  {}
+>  {=}  =>  {}
+>  {}  =>  {,}.
+The property list \g_tmpa_prop contains the pairs (without outer braces):
+>  {\a }  =>  {b}
+>  {\c }  =>  { \d =e }
+>  {}  =>  {}
+>  {=}  =>  {}
+>  {}  =>  {,}.
+Defining \c_A_prop on line ...
+The property list \c_A_prop contains the pairs (without outer braces):
+>  {\a }  =>  {b}
+>  {\c }  =>  { \d =e }
+>  {}  =>  {}
+>  {=}  =>  {}
+>  {}  =>  {,}.
+============================================================
+============================================================
+TEST 2: prop from_keyval invalid
+============================================================
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in '{=}' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in 'a==b' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in '==' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+The property list \l_tmpa_prop is empty
+> .
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in '{=}' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in 'a==b' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in '==' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+The property list \g_tmpa_prop is empty
+> .
+Defining \c_B_prop on line ...
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in '{=}' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in 'a==b' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Missing/extra '=' in '==' (in '..._keyval:Nn')
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+The property list \c_B_prop is empty
+> .
+============================================================





More information about the latex3-commits mailing list