[latex3-commits] [git/LaTeX3-latex3-latex3] text-map: Correct handling of Hangul runs (9f6c0619d)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Aug 8 23:19:35 CEST 2022


Repository : https://github.com/latex3/latex3
On branch  : text-map
Link       : https://github.com/latex3/latex3/commit/9f6c0619da7bc2fde56d22cf937923336c1b0676

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

commit 9f6c0619da7bc2fde56d22cf937923336c1b0676
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Aug 8 22:19:35 2022 +0100

    Correct handling of Hangul runs


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

9f6c0619da7bc2fde56d22cf937923336c1b0676
 l3kernel/l3text-map.dtx                 | 40 ++++++++++++++++++---------------
 l3kernel/testfiles/m3text006.luatex.tlg |  4 ++--
 l3kernel/testfiles/m3text006.lvt        |  2 +-
 l3kernel/testfiles/m3text006.ptex.tlg   |  4 ++--
 l3kernel/testfiles/m3text006.tlg        |  4 ++--
 l3kernel/testfiles/m3text006.xetex.tlg  |  4 ++--
 6 files changed, 31 insertions(+), 27 deletions(-)

diff --git a/l3kernel/l3text-map.dtx b/l3kernel/l3text-map.dtx
index 975009a0d..e4b7080fd 100644
--- a/l3kernel/l3text-map.dtx
+++ b/l3kernel/l3text-map.dtx
@@ -103,9 +103,9 @@
 %   }
 % \begin{macro}[EXP]{\@@_map_hangul:Nnnw}
 % \begin{macro}[EXP]{\@@_map_hangul:NnnN}
-% \begin{macro}[EXP]{\@@_map_hangul:Nnnnn}
-% \begin{macro}[EXP]{\@@_map_hangul:Nnnnw}
-% \begin{macro}[EXP]{\@@_map_hangul:nNnnnn}
+% \begin{macro}[EXP]{\@@_map_hangul:Nnnn}
+% \begin{macro}[EXP]{\@@_map_hangul_aux:Nnnnw}
+% \begin{macro}[EXP]{\@@_map_hangul:nNnnnw}
 % \begin{macro}[EXP]{\@@_map_hangul_loop:Nnnnnw}
 % \begin{macro}[EXP]{\@@_map_hangul_next:Nnnn}
 % \begin{macro}[EXP]{\@@_map_hangul_end:nw}
@@ -322,13 +322,13 @@
   {
     \@@_map_output:Nn #1 {#2}
     \@@_map_hangul:Nnnw
-      #1 {#3} { L V { LV } { LVT } }
+      #1 {#3} { L ; V ; LV ; LVT }
   }
 \cs_new:Npn \@@_map_LV:Nnn #1#2#3
   {
     \@@_map_output:Nn #1 {#2}
     \@@_map_hangul:Nnnw
-      #1 {#3} { V  T }
+      #1 {#3} { V ; T }
   }
 \cs_new:Npn \@@_map_LVT:Nnn #1#2#3
   {
@@ -358,16 +358,24 @@
         #1 {#2}
         \@@_map_loop:Nnw #1 { }
       }
-      { \@@_codepoint_process:nN { \@@_map_hangul:Nnnnn #1 {#2} {#3} } #4 }
+      {
+        \@@_codepoint_process:nN
+          { \@@_map_hangul:Nnnn #1 {#2} {#3} } #4
+      }
+  }
+\cs_new:Npn \@@_map_hangul:Nnnn #1#2#3#4
+  {
+    \@@_map_hangul_aux:Nnnw #1 {#2} {#4}
+      #3 ; \q_recursion_tail ; \q_recursion_stop
   }
-\cs_new:Npn \@@_map_hangul:Nnnnn #1#2#3#4
-  { \@@_map_hangul:Nnnnw #1 {#2} {#4} #3 ; }
-\cs_new:Npn \@@_map_hangul:Nnnnw #1#2#3#4#5 ;
+\cs_new:Npn \@@_map_hangul_aux:Nnnw #1#2#3#4 ;
   {
-    \exp_args:Nv \@@_map_hangul:nNnnnn { c_@@_grapheme_ #4 _clist }
-      #1 {#2} {#3} {#4} {#5}
+    \quark_if_recursion_tail_stop_do:nn {#4}
+      { \@@_map_loop:Nnw #1 {#2} #3 }
+    \exp_args:Nv \@@_map_hangul:nNnnnw { c_@@_grapheme_ #4 _clist }
+      #1 {#2} {#3} {#4}
   }
-\cs_new:Npn \@@_map_hangul:nNnnnn #1#2#3#4#5#6
+\cs_new:Npn \@@_map_hangul:nNnnnw #1#2#3#4#5#6  \q_recursion_stop
   {
     \@@_map_hangul_loop:Nnnnnw #2 {#3} {#4} {#5} {#6}
       #1 , \q_@@_recursion_tail .. , \q_@@_recursion_stop
@@ -391,11 +399,7 @@
       }
   }
 \cs_new:Npn \@@_map_hangul_next:Nnnn #1#2#3#4
-  {
-    \tl_if_blank:nTF {#4}
-      { \@@_map_loop:Nnw #1 {#2} #3 }
-      { \@@_map_hangul:Nnnnw #1 {#2} {#3} #4 ; }
-  }
+  { \@@_map_hangul_aux:Nnnw #1 {#2} {#3} #4 \q_recursion_stop }
 \cs_new:Npn \@@_map_hangul_end:nw #1#2 \q_@@_recursion_stop {#1}
 \cs_new:Npn \@@_map_hangul_L:Nnn #1#2#3
   {
@@ -405,7 +409,7 @@
 \cs_new:Npn \@@_map_hangul_LV:Nnn #1#2#3
   {
     \@@_map_hangul:Nnnw
-      #1 {#2#3} { V  T }
+      #1 {#2#3} { VT }
   }
 \cs_new_eq:NN \@@_map_hangul_V:Nnn \@@_map_hangul_LV:Nnn
 \cs_new:Npn \@@_map_hangul_LVT:Nnn #1#2#3
diff --git a/l3kernel/testfiles/m3text006.luatex.tlg b/l3kernel/testfiles/m3text006.luatex.tlg
index 9aa63392f..b585021ad 100644
--- a/l3kernel/testfiles/m3text006.luatex.tlg
+++ b/l3kernel/testfiles/m3text006.luatex.tlg
@@ -228,11 +228,11 @@ TRUE
 TRUE
 TRUE
 TRUE
-  ^^f7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^f7 [999.0] HANGUL JONGSEONG KIYEOK (T) ^^f7 [0.3]
 TRUE
 TRUE
 TRUE
-  ^^f7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^d7 [6.0] HANGUL SYLLABLE GAG (LVT) ^^f7 [0.3]
+TRUE
+TRUE
 TRUE
 TRUE
 TRUE
diff --git a/l3kernel/testfiles/m3text006.lvt b/l3kernel/testfiles/m3text006.lvt
index 1fb841ab8..698102590 100644
--- a/l3kernel/testfiles/m3text006.lvt
+++ b/l3kernel/testfiles/m3text006.lvt
@@ -75,7 +75,7 @@
           { \text_map_function:nN {#2} \test_auxvii:n }
           {#3}
           { \TRUE }
-          { \LONGTYPEOUT {#1} }
+          { \LONGTYPEOUT {#1} }%\LONGTYPEOUT {#2:\text_map_function:nN {#2} \test_auxvii:n :#3} }
       }
     \cs_set:Npn \test_auxvii:n #1 { (#1) }
     \bool_lazy_or:nnTF
diff --git a/l3kernel/testfiles/m3text006.ptex.tlg b/l3kernel/testfiles/m3text006.ptex.tlg
index 9aa63392f..b585021ad 100644
--- a/l3kernel/testfiles/m3text006.ptex.tlg
+++ b/l3kernel/testfiles/m3text006.ptex.tlg
@@ -228,11 +228,11 @@ TRUE
 TRUE
 TRUE
 TRUE
-  ^^f7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^f7 [999.0] HANGUL JONGSEONG KIYEOK (T) ^^f7 [0.3]
 TRUE
 TRUE
 TRUE
-  ^^f7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^d7 [6.0] HANGUL SYLLABLE GAG (LVT) ^^f7 [0.3]
+TRUE
+TRUE
 TRUE
 TRUE
 TRUE
diff --git a/l3kernel/testfiles/m3text006.tlg b/l3kernel/testfiles/m3text006.tlg
index d0d8ec14c..95601384e 100644
--- a/l3kernel/testfiles/m3text006.tlg
+++ b/l3kernel/testfiles/m3text006.tlg
@@ -228,11 +228,11 @@ TRUE
 TRUE
 TRUE
 TRUE
-  ^^c3^^b7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^c3^^b7 [999.0] HANGUL JONGSEONG KIYEOK (T) ^^c3^^b7 [0.3]
 TRUE
 TRUE
 TRUE
-  ^^c3^^b7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^c3^^97 [6.0] HANGUL SYLLABLE GAG (LVT) ^^c3^^b7 [0.3]
+TRUE
+TRUE
 TRUE
 TRUE
 TRUE
diff --git a/l3kernel/testfiles/m3text006.xetex.tlg b/l3kernel/testfiles/m3text006.xetex.tlg
index 9aa63392f..b585021ad 100644
--- a/l3kernel/testfiles/m3text006.xetex.tlg
+++ b/l3kernel/testfiles/m3text006.xetex.tlg
@@ -228,11 +228,11 @@ TRUE
 TRUE
 TRUE
 TRUE
-  ^^f7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^f7 [999.0] HANGUL JONGSEONG KIYEOK (T) ^^f7 [0.3]
 TRUE
 TRUE
 TRUE
-  ^^f7 [0.2] HANGUL CHOSEONG KIYEOK (L) ^^d7 [6.0] HANGUL SYLLABLE GAG (LVT) ^^f7 [0.3]
+TRUE
+TRUE
 TRUE
 TRUE
 TRUE





More information about the latex3-commits mailing list.