[latex3-commits] [git/LaTeX3-latex3-latex3] master: Leave 'normal' actives unaffected by case changing (fixes #715) (a2178b92b)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue May 5 12:07:25 CEST 2020


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

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

commit a2178b92b1cd813caf6c1fe4f6e4a24709352768
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue May 5 11:07:07 2020 +0100

    Leave 'normal' actives unaffected by case changing (fixes #715)


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

a2178b92b1cd813caf6c1fe4f6e4a24709352768
 l3kernel/CHANGELOG.md                   |  3 +++
 l3kernel/l3text-case.dtx                | 23 ++++++++++++-----------
 l3kernel/testfiles/m3text002.luatex.tlg |  8 ++++++++
 l3kernel/testfiles/m3text002.lvt        | 12 ++++++++++++
 l3kernel/testfiles/m3text002.tlg        |  8 ++++++++
 l3kernel/testfiles/m3text002.uptex.tlg  |  8 ++++++++
 l3kernel/testfiles/m3text002.xetex.tlg  |  8 ++++++++
 7 files changed, 59 insertions(+), 11 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 7908779c2..9ce1cd84f 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -10,6 +10,9 @@ this project uses date-based 'snapshot' version identifiers.
 ### Added
 - Recognize the exponent marker `E` (same as `e`) in floating point numbers
 
+### Fixed
+- Leave active characters untouched when case-changing (see #715)
+
 ## [2020-04-06]
 
 ### Added
diff --git a/l3kernel/l3text-case.dtx b/l3kernel/l3text-case.dtx
index cb898633a..dd930017e 100644
--- a/l3kernel/l3text-case.dtx
+++ b/l3kernel/l3text-case.dtx
@@ -160,7 +160,7 @@
 % \begin{macro}[EXP]
 %   {\@@_change_case_char_title:nN, \@@_change_case_char_titleonly:nN}
 % \begin{macro}[EXP]{\@@_change_case_char_title:nnnN}
-% \begin{macro}[EXP]{\@@_change_case_char_char:nnnN}
+% \begin{macro}[EXP]{\@@_change_case_char:nnnN, \@@_change_case_char_aux:nnnN}
 % \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnNN}
 % \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnNNN}
 % \begin{macro}[EXP]{\@@_change_case_char_UTFviii:nnnNNNNN}
@@ -568,19 +568,23 @@
 %   Unicode character, which is then used in a lookup. (As will become
 %   obvious below, there is no intention here of covering all of Unicode.)
 %    \begin{macrocode}
-\bool_lazy_or:nnTF
-  { \sys_if_engine_luatex_p: }
-  { \sys_if_engine_xetex_p: }
+\cs_new:Npn \@@_change_case_char:nnnN #1#2#3#4
   {
-    \cs_new:Npn \@@_change_case_char:nnnN #1#2#3#4
+    \token_if_active:NTF #4
+      { \@@_change_case_store:n {#4} }
       {
         \@@_change_case_store:e
           { \use:c { char_ #1 case :N } #4 }
-        \use:c { @@_change_case_char_next_ #2 :nn } {#2} {#3}
       }
+    \use:c { @@_change_case_char_next_ #2 :nn } {#2} {#3}
   }
+\bool_lazy_or:nnF
+  { \sys_if_engine_luatex_p: }
+  { \sys_if_engine_xetex_p: }
   {
-    \cs_new:Npn \@@_change_case_char:nnnN #1#2#3#4
+    \cs_new_eq:NN \@@_change_case_char_aux:nnnN
+      \@@_change_case_char:nnnN
+    \cs_gset:Npn \@@_change_case_char:nnnN #1#2#3#4
       {
         \int_compare:nNnTF { `#4 } > { "80 }
           {
@@ -593,10 +597,7 @@
               }
                 {#1} {#2} {#3} #4
           }
-          {
-            \@@_change_case_store:e{ \use:c { char_ #1 case :N } #4 }
-            \use:c { @@_change_case_char_next_ #2 :nn } {#2} {#3}
-          }
+          { \@@_change_case_char_aux:nnnN {#1} {#2} {#3} #4 }
        }
     \cs_new:Npn \@@_change_case_char_UTFviii:nnnNN #1#2#3#4#5
       { \@@_change_case_char_UTFviii:nnnn {#1} {#2} {#3} {#4#5} }
diff --git a/l3kernel/testfiles/m3text002.luatex.tlg b/l3kernel/testfiles/m3text002.luatex.tlg
index 968b751a5..3ad33a3d1 100644
--- a/l3kernel/testfiles/m3text002.luatex.tlg
+++ b/l3kernel/testfiles/m3text002.luatex.tlg
@@ -267,3 +267,11 @@ TEST 24: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
+============================================================
+TEST 25: Active chars
+============================================================
+"`lo"=rem"'
+"`LO"=REM"'
+"`Lo"=rem"'
+"`Lo"=rem"'
+============================================================
diff --git a/l3kernel/testfiles/m3text002.lvt b/l3kernel/testfiles/m3text002.lvt
index 3bd7cbff5..9a01ccf37 100644
--- a/l3kernel/testfiles/m3text002.lvt
+++ b/l3kernel/testfiles/m3text002.lvt
@@ -288,4 +288,16 @@
     \test:n { \"{a} \u{e} \H{i} \v{o} \.{u} }
   }
 
+\group_begin:
+
+\char_set_catcode_active:N "
+
+\TESTEXP { Active~chars }
+  {
+    \test:n { "`Lo"=rem"' }
+  }
+
+\group_end:
+
+
 \END
diff --git a/l3kernel/testfiles/m3text002.tlg b/l3kernel/testfiles/m3text002.tlg
index 411e2bbb5..f2378a713 100644
--- a/l3kernel/testfiles/m3text002.tlg
+++ b/l3kernel/testfiles/m3text002.tlg
@@ -259,3 +259,11 @@ TEST 24: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
+============================================================
+TEST 25: Active chars
+============================================================
+"`lo"=rem"'
+"`LO"=REM"'
+"`lo"=rem"'
+"`Lo"=rem"'
+============================================================
diff --git a/l3kernel/testfiles/m3text002.uptex.tlg b/l3kernel/testfiles/m3text002.uptex.tlg
index 90506d405..f8211f22c 100644
--- a/l3kernel/testfiles/m3text002.uptex.tlg
+++ b/l3kernel/testfiles/m3text002.uptex.tlg
@@ -263,3 +263,11 @@ TEST 24: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
+============================================================
+TEST 25: Active chars
+============================================================
+"`lo"=rem"'
+"`LO"=REM"'
+"`lo"=rem"'
+"`Lo"=rem"'
+============================================================
diff --git a/l3kernel/testfiles/m3text002.xetex.tlg b/l3kernel/testfiles/m3text002.xetex.tlg
index 18cf4fd21..58819281a 100644
--- a/l3kernel/testfiles/m3text002.xetex.tlg
+++ b/l3kernel/testfiles/m3text002.xetex.tlg
@@ -263,3 +263,11 @@ TEST 24: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
+============================================================
+TEST 25: Active chars
+============================================================
+"`lo"=rem"'
+"`LO"=REM"'
+"`Lo"=rem"'
+"`Lo"=rem"'
+============================================================





More information about the latex3-commits mailing list.