[latex3-commits] [git/LaTeX3-latex3-latex3] main: Tests for recent changes to \peek_analysis_map_inline:n (#1109 #1110 #1113) (942856463)
Bruno Le Floch
blflatex at gmail.com
Mon Oct 3 23:04:33 CEST 2022
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/942856463c74c448b2abb5982f95372829c417ac
>---------------------------------------------------------------
commit 942856463c74c448b2abb5982f95372829c417ac
Author: Bruno Le Floch <blflatex at gmail.com>
Date: Mon Oct 3 23:04:33 2022 +0200
Tests for recent changes to \peek_analysis_map_inline:n (#1109 #1110 #1113)
>---------------------------------------------------------------
942856463c74c448b2abb5982f95372829c417ac
l3kernel/testfiles/m3peek003.lvt | 31 ++++++++++++++++++++++++++++++-
l3kernel/testfiles/m3peek003.tlg | 10 +++++++++-
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/l3kernel/testfiles/m3peek003.lvt b/l3kernel/testfiles/m3peek003.lvt
index a1c057de3..e84c16d6e 100644
--- a/l3kernel/testfiles/m3peek003.lvt
+++ b/l3kernel/testfiles/m3peek003.lvt
@@ -1,5 +1,5 @@
%
-% Copyright (C) 2020,2021 The LaTeX Project
+% Copyright (C) 2020-2022 The LaTeX Project
%
\documentclass{minimal}
@@ -31,8 +31,37 @@
a { ~ { } \c_group_begin_token \c_space_token } X
Z { TRUE }
}
+
+% test outer macros
+\cs_set:Npn \test_if:w { \if_meaning:w \outermacro }
+\outer \def \outermacro { }
+\peek_analysis_map_inline:n
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN \TYPE
+ \exp_after:wN \exp_after:wN \exp_after:wN { \exp_after:wN \tex_meaning:D #1 , #2 , #3 }
+ \exp_after:wN \test_if:w #1
+ \exp_after:wN \peek_analysis_map_break:
+ \fi:
+ }
+# \exp_after:wN \c_space_token \c_parameter_token
+\outermacro
+\TYPE{TRUE}
\endgroup
+\cs_set_protected:Npn \test:
+ {
+ \peek_analysis_map_inline:n
+ {
+ \exp_after:wN \if_meaning:w \exp_after:wN \stop ##1
+ \exp_after:wN \peek_analysis_map_break:
+ \fi:
+ \TYPE { \tl_to_str:n {##1} , ##2 , ##3 }
+ }
+ \c_group_begin_token
+ }
+\exp_after:wN \test: \exp_not:N \prg_do_nothing: \stop
+
+
% Original report from E.G.
\cs_new_eq:NN \prro \peek_regex_replace_once:nn
\ExplSyntaxOff
diff --git a/l3kernel/testfiles/m3peek003.tlg b/l3kernel/testfiles/m3peek003.tlg
index d87929e4f..11bfd6358 100644
--- a/l3kernel/testfiles/m3peek003.tlg
+++ b/l3kernel/testfiles/m3peek003.tlg
@@ -12,8 +12,16 @@ a,97,B
\exp_not:n {\c_group_begin_token },-1,0
\exp_not:n {\c_space_token },-1,0
\if_false: {\fi: },125,2
-\exp_not:N X,88,D
+\__kernel_exp_not:w \exp_after:wN {\exp_not:N X},88,D
TRUE
============================================================
+macro parameter character #,35,6
+\expandafter,-1,0
+blank space ,-1,0
+macro parameter character #,-1,0
+\outer macro:->,-1,0
+TRUE
+\exp_not:n {\c_group_begin_token },-1,0
+\__kernel_exp_not:w \exp_after:wN {\exp_not:N \prg_do_nothing: },-1,0
Defining \prro on line ...
TRUE
More information about the latex3-commits
mailing list.