[latex3-commits] [git/LaTeX3-latex3-latex3] main: Allow for multi-part BCP47 strings in case changing (b1ad4d7a5)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jan 22 13:36:15 CET 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/b1ad4d7a500c77b9a1887d43c49bde05aef5ee73

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

commit b1ad4d7a500c77b9a1887d43c49bde05aef5ee73
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jan 22 12:36:15 2023 +0000

    Allow for multi-part BCP47 strings in case changing


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

b1ad4d7a500c77b9a1887d43c49bde05aef5ee73
 l3kernel/CHANGELOG.md                   |  3 +++
 l3kernel/l3text-case.dtx                |  6 ++++-
 l3kernel/testfiles/m3text002.luatex.tlg | 41 ++++++++++++++++++---------------
 l3kernel/testfiles/m3text002.lvt        |  5 ++++
 l3kernel/testfiles/m3text002.tlg        | 41 ++++++++++++++++++---------------
 l3kernel/testfiles/m3text002.xetex.tlg  | 41 ++++++++++++++++++---------------
 6 files changed, 82 insertions(+), 55 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 9f6dfb0fe..af4fc6c5b 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Fixed
+- Allow for multi-part BCP47 strings in case changing
+
 ### Changed
 - Leave catcode of `&` unchanged in code environment
 
diff --git a/l3kernel/l3text-case.dtx b/l3kernel/l3text-case.dtx
index c55ddfcd7..b54194337 100644
--- a/l3kernel/l3text-case.dtx
+++ b/l3kernel/l3text-case.dtx
@@ -251,7 +251,11 @@
   {
     \cs_if_exist:cTF { @@_change_case_ #2 _ #5 -x- #3 :nnnn }
       { \@@_change_case_auxii:nnn {#1} {#2} { #5 -x- #3 } }
-      { \@@_change_case_auxii:nnn {#1} {#2} {#4} }
+      {
+        \cs_if_exist:cTF { @@_change_case_ #2 _ #5 :nnnn }
+          { \@@_change_case_auxii:nnn {#1} {#2} {#5} }
+          { \@@_change_case_auxii:nnn {#1} {#2} {#4} }
+      }
   }
 \cs_new:Npn \@@_change_case_auxii:nnn #1#2#3
   {
diff --git a/l3kernel/testfiles/m3text002.luatex.tlg b/l3kernel/testfiles/m3text002.luatex.tlg
index 96bbeee9a..c555db7a7 100644
--- a/l3kernel/testfiles/m3text002.luatex.tlg
+++ b/l3kernel/testfiles/m3text002.luatex.tlg
@@ -132,7 +132,12 @@ TEST 13: Cyrillic
 Доклады Академии наук
 ============================================================
 ============================================================
-TEST 14: Armenian
+TEST 14: BCP47 parts
+============================================================
+ΑΔΙΚΟΣ, ΚΕΙΜΕΝΟ, ΙΡΙΔΑ
+============================================================
+============================================================
+TEST 15: Armenian
 ============================================================
 ԵՐԵՒԱՆ
 ԵՐԵՎԱՆ
@@ -142,13 +147,13 @@ TEST 14: Armenian
 Եւան
 ============================================================
 ============================================================
-TEST 15: German-alternative
+TEST 16: German-alternative
 ============================================================
 FUSSBALL
 FUẞBALL
 ============================================================
 ============================================================
-TEST 16: Greek
+TEST 17: Greek
 ============================================================
 ΆΔΙΚΟΣ, ΚΕΊΜΕΝΟ, ΊΡΙΔΑ
 ΑΔΙΚΟΣ, ΚΕΙΜΕΝΟ, ΙΡΙΔΑ
@@ -194,7 +199,7 @@ TEST 16: Greek
 ῌ
 ============================================================
 ============================================================
-TEST 17: Turkish/Azeri
+TEST 18: Turkish/Azeri
 ============================================================
 ragıp hul^^fbsi ^^f6zdem
 ragip hul^^fbsi̇ ^^f6zdem
@@ -206,7 +211,7 @@ Ip hul^^fbsi ^^f6zdem
 Ip hul^^fbsi ^^f6zdem
 ============================================================
 ============================================================
-TEST 18: Lithuanian
+TEST 19: Lithuanian
 ============================================================
 i̇̀i̇́i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 ^^ec^^edĩìíĩj̀j́j̃į̀į́į̃
@@ -218,7 +223,7 @@ Ìi̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 İ̀i̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 ============================================================
 ============================================================
-TEST 19: Medieval Latin
+TEST 20: Medieval Latin
 ============================================================
 lupus
 lvpvs
@@ -226,7 +231,7 @@ LVPVS
 LUPUS
 ============================================================
 ============================================================
-TEST 20: Dutch
+TEST 21: Dutch
 ============================================================
 ijsselmeer
 ijsselmeer
@@ -242,13 +247,13 @@ Im
 Im
 ============================================================
 ============================================================
-TEST 21: Titlecase exceptions
+TEST 22: Titlecase exceptions
 ============================================================
 Ssoo
 Dž!
 ============================================================
 ============================================================
-TEST 22: Case changing braced arguments
+TEST 23: Case changing braced arguments
 ============================================================
 foo \emph {BAR} {baz}
 FOO \emph {BAR} {BAZ}
@@ -260,7 +265,7 @@ FOO \emph {BAR} {BAZ}
 \emph {BAR} {BAZ}
 ============================================================
 ============================================================
-TEST 23: Expanding content
+TEST 24: Expanding content
 ============================================================
 some text hello
 SOME TEXT HELLO
@@ -288,7 +293,7 @@ Some text \cs_tmp:w
 \cs_tmp:w  Sometext
 ============================================================
 ============================================================
-TEST 24: Math-mode escape
+TEST 25: Math-mode escape
 ============================================================
 some text $y = mx + c$
 SOME TEXT $y = mx + c$
@@ -304,7 +309,7 @@ Opps not close token in $y = mx + c
 Opps not close token in $y = mx + c
 ============================================================
 ============================================================
-TEST 25: Nesting
+TEST 26: Nesting
 ============================================================
 HELLO
 hello
@@ -312,7 +317,7 @@ FUSSBALL
 ὈΔΥΣΣΕΎΣ
 ============================================================
 ============================================================
-TEST 26: Letter-like commands
+TEST 27: Letter-like commands
 ============================================================
 \aa \aa \J \ae \dh \ss \l \o 
 \AA \AA \J \AE \DH \SS \L \O 
@@ -320,7 +325,7 @@ TEST 26: Letter-like commands
 \AA \aa \J \ae \dh \ss \l \O 
 ============================================================
 ============================================================
-TEST 27: Accents
+TEST 28: Accents
 ============================================================
 \"{a}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {E}\H {I}\v {O}\.{U}
@@ -328,7 +333,7 @@ TEST 27: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
 ============================================================
-TEST 28: Active chars
+TEST 29: Active chars
 ============================================================
 "`lo"=rem"'
 "`LO"=REM"'
@@ -336,7 +341,7 @@ TEST 28: Active chars
 "`Lo"=rem"'
 ============================================================
 ============================================================
-TEST 29: Case changing exclusions
+TEST 30: Case changing exclusions
 ============================================================
 Variant \tl_show:x already defined; not changing it on line ...
 > foo\NoCaseChange {BAR}.
@@ -347,7 +352,7 @@ l. ...  }
 l. ...  }
 ============================================================
 ============================================================
-TEST 30: Case change switching
+TEST 31: Case change switching
 ============================================================
 lower
 UPPER
@@ -359,7 +364,7 @@ Words UPPER
 Words \text_case_switch:nnnn {normal}{lower}{UPPER}{Title}
 ============================================================
 ============================================================
-TEST 31: Case change replacements
+TEST 32: Case change replacements
 ============================================================
 Defining \l__text_case_\foo_tl on line ...
 > fooreplaced.
diff --git a/l3kernel/testfiles/m3text002.lvt b/l3kernel/testfiles/m3text002.lvt
index bf379eb9d..85384f515 100644
--- a/l3kernel/testfiles/m3text002.lvt
+++ b/l3kernel/testfiles/m3text002.lvt
@@ -149,6 +149,11 @@
     \test:n { Доклады~Академии~наук }
   }
 
+\TESTEXP { BCP47~parts }
+  {
+     \text_uppercase:nn { el-monotonic } { άδικος,~κείμενο,~ίριδα }
+  }
+
 \TESTEXP { Armenian }
   {
     \text_uppercase:n                { Երևան } \NEWLINE
diff --git a/l3kernel/testfiles/m3text002.tlg b/l3kernel/testfiles/m3text002.tlg
index e48c1f0e7..0d4d08e65 100644
--- a/l3kernel/testfiles/m3text002.tlg
+++ b/l3kernel/testfiles/m3text002.tlg
@@ -132,7 +132,12 @@ TEST 13: Cyrillic
 ^^d0^^94^^d0^^be^^d0^^ba^^d0^^bb^^d0^^b0^^d0^^b4^^d1^^8b ^^d0^^90^^d0^^ba^^d0^^b0^^d0^^b4^^d0^^b5^^d0^^bc^^d0^^b8^^d0^^b8 ^^d0^^bd^^d0^^b0^^d1^^83^^d0^^ba
 ============================================================
 ============================================================
-TEST 14: Armenian
+TEST 14: BCP47 parts
+============================================================
+^^ce^^91^^ce^^94^^ce^^99^^ce^^9a^^ce^^9f^^ce^^a3, ^^ce^^9a^^ce^^95^^ce^^99^^ce^^9c^^ce^^95^^ce^^9d^^ce^^9f, ^^ce^^99^^ce^^a1^^ce^^99^^ce^^94^^ce^^91
+============================================================
+============================================================
+TEST 15: Armenian
 ============================================================
 ^^d4^^b5^^d5^^90^^d4^^b5^^d5^^92^^d4^^b1^^d5^^86
 ^^d4^^b5^^d5^^90^^d4^^b5^^d5^^8e^^d4^^b1^^d5^^86
@@ -142,13 +147,13 @@ TEST 14: Armenian
 ^^d4^^b5^^d6^^82^^d5^^a1^^d5^^b6
 ============================================================
 ============================================================
-TEST 15: German-alternative
+TEST 16: German-alternative
 ============================================================
 FUSSBALL
 FU^^e1^^ba^^9eBALL
 ============================================================
 ============================================================
-TEST 16: Greek
+TEST 17: Greek
 ============================================================
 ^^ce^^86^^ce^^94^^ce^^99^^ce^^9a^^ce^^9f^^ce^^a3, ^^ce^^9a^^ce^^95^^ce^^8a^^ce^^9c^^ce^^95^^ce^^9d^^ce^^9f, ^^ce^^8a^^ce^^a1^^ce^^99^^ce^^94^^ce^^91
 ^^ce^^91^^ce^^94^^ce^^99^^ce^^9a^^ce^^9f^^ce^^a3, ^^ce^^9a^^ce^^95^^ce^^99^^ce^^9c^^ce^^95^^ce^^9d^^ce^^9f, ^^ce^^99^^ce^^a1^^ce^^99^^ce^^94^^ce^^91
@@ -194,7 +199,7 @@ TEST 16: Greek
 ^^ce^^97^^cd^^85
 ============================================================
 ============================================================
-TEST 17: Turkish/Azeri
+TEST 18: Turkish/Azeri
 ============================================================
 rag^^c4^^b1p hul^^c3^^bbsi ^^c3^^b6zdem
 ragip hul^^c3^^bbsi^^cc^^87 ^^c3^^b6zdem
@@ -206,7 +211,7 @@ Ip hul^^c3^^bbsi ^^c3^^b6zdem
 Ip hul^^c3^^bbsi ^^c3^^b6zdem
 ============================================================
 ============================================================
-TEST 18: Lithuanian
+TEST 19: Lithuanian
 ============================================================
 i^^cc^^87^^cc^^80i^^cc^^87^^cc^^81i^^cc^^87^^cc^^83i^^cc^^87^^cc^^80i^^cc^^87^^cc^^81i^^cc^^87^^cc^^83j^^cc^^87^^cc^^80j^^cc^^87^^cc^^81j^^cc^^87^^cc^^83^^c4^^af^^cc^^87^^cc^^80^^c4^^af^^cc^^87^^cc^^81^^c4^^af^^cc^^87^^cc^^83
 ^^c3^^ac^^c3^^ad^^c4^^a9i^^cc^^80i^^cc^^81i^^cc^^83j^^cc^^80j^^cc^^81j^^cc^^83^^c4^^af^^cc^^80^^c4^^af^^cc^^81^^c4^^af^^cc^^83
@@ -218,7 +223,7 @@ I^^cc^^80i^^cc^^87^^cc^^80i^^cc^^87^^cc^^83i^^cc^^87^^cc^^80i^^cc^^87^^cc^^81i^^
 I^^cc^^87^^cc^^80i^^cc^^87^^cc^^80i^^cc^^87^^cc^^83i^^cc^^87^^cc^^80i^^cc^^87^^cc^^81i^^cc^^87^^cc^^83j^^cc^^87^^cc^^80j^^cc^^87^^cc^^81j^^cc^^87^^cc^^83^^c4^^af^^cc^^87^^cc^^80^^c4^^af^^cc^^87^^cc^^81^^c4^^af^^cc^^87^^cc^^83
 ============================================================
 ============================================================
-TEST 19: Medieval Latin
+TEST 20: Medieval Latin
 ============================================================
 lupus
 lvpvs
@@ -226,7 +231,7 @@ LVPVS
 LUPUS
 ============================================================
 ============================================================
-TEST 20: Dutch
+TEST 21: Dutch
 ============================================================
 ijsselmeer
 ijsselmeer
@@ -242,13 +247,13 @@ Im
 Im
 ============================================================
 ============================================================
-TEST 21: Titlecase exceptions
+TEST 22: Titlecase exceptions
 ============================================================
 Ssoo
 ^^c7^^85!
 ============================================================
 ============================================================
-TEST 22: Case changing braced arguments
+TEST 23: Case changing braced arguments
 ============================================================
 foo \emph {BAR} {baz}
 FOO \emph {BAR} {BAZ}
@@ -260,7 +265,7 @@ FOO \emph {BAR} {BAZ}
 \emph {BAR} {BAZ}
 ============================================================
 ============================================================
-TEST 23: Expanding content
+TEST 24: Expanding content
 ============================================================
 some text hello
 SOME TEXT HELLO
@@ -288,7 +293,7 @@ Some text \cs_tmp:w
 \cs_tmp:w  Sometext
 ============================================================
 ============================================================
-TEST 24: Math-mode escape
+TEST 25: Math-mode escape
 ============================================================
 some text $y = mx + c$
 SOME TEXT $y = mx + c$
@@ -304,7 +309,7 @@ Opps not close token in $y = mx + c
 Opps not close token in $y = mx + c
 ============================================================
 ============================================================
-TEST 25: Nesting
+TEST 26: Nesting
 ============================================================
 HELLO
 hello
@@ -312,7 +317,7 @@ FUSSBALL
 ^^e1^^bd^^88^^ce^^94^^ce^^a5^^ce^^a3^^ce^^a3^^ce^^95^^ce^^8e^^ce^^a3
 ============================================================
 ============================================================
-TEST 26: Letter-like commands
+TEST 27: Letter-like commands
 ============================================================
 \aa \aa \J \ae \dh \ss \l \o 
 \AA \AA \J \AE \DH \SS \L \O 
@@ -320,7 +325,7 @@ TEST 26: Letter-like commands
 \AA \aa \J \ae \dh \ss \l \O 
 ============================================================
 ============================================================
-TEST 27: Accents
+TEST 28: Accents
 ============================================================
 \"{a}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {E}\H {I}\v {O}\.{U}
@@ -328,7 +333,7 @@ TEST 27: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
 ============================================================
-TEST 28: Active chars
+TEST 29: Active chars
 ============================================================
 "`lo"=rem"'
 "`LO"=REM"'
@@ -336,7 +341,7 @@ TEST 28: Active chars
 "`Lo"=rem"'
 ============================================================
 ============================================================
-TEST 29: Case changing exclusions
+TEST 30: Case changing exclusions
 ============================================================
 Variant \tl_show:x already defined; not changing it on line ...
 > foo\NoCaseChange {BAR}.
@@ -347,7 +352,7 @@ l. ...  }
 l. ...  }
 ============================================================
 ============================================================
-TEST 30: Case change switching
+TEST 31: Case change switching
 ============================================================
 lower
 UPPER
@@ -359,7 +364,7 @@ Words UPPER
 Words \text_case_switch:nnnn {normal}{lower}{UPPER}{Title}
 ============================================================
 ============================================================
-TEST 31: Case change replacements
+TEST 32: Case change replacements
 ============================================================
 Defining \l__text_case_\foo_tl on line ...
 > fooreplaced.
diff --git a/l3kernel/testfiles/m3text002.xetex.tlg b/l3kernel/testfiles/m3text002.xetex.tlg
index 96bbeee9a..c555db7a7 100644
--- a/l3kernel/testfiles/m3text002.xetex.tlg
+++ b/l3kernel/testfiles/m3text002.xetex.tlg
@@ -132,7 +132,12 @@ TEST 13: Cyrillic
 Доклады Академии наук
 ============================================================
 ============================================================
-TEST 14: Armenian
+TEST 14: BCP47 parts
+============================================================
+ΑΔΙΚΟΣ, ΚΕΙΜΕΝΟ, ΙΡΙΔΑ
+============================================================
+============================================================
+TEST 15: Armenian
 ============================================================
 ԵՐԵՒԱՆ
 ԵՐԵՎԱՆ
@@ -142,13 +147,13 @@ TEST 14: Armenian
 Եւան
 ============================================================
 ============================================================
-TEST 15: German-alternative
+TEST 16: German-alternative
 ============================================================
 FUSSBALL
 FUẞBALL
 ============================================================
 ============================================================
-TEST 16: Greek
+TEST 17: Greek
 ============================================================
 ΆΔΙΚΟΣ, ΚΕΊΜΕΝΟ, ΊΡΙΔΑ
 ΑΔΙΚΟΣ, ΚΕΙΜΕΝΟ, ΙΡΙΔΑ
@@ -194,7 +199,7 @@ TEST 16: Greek
 ῌ
 ============================================================
 ============================================================
-TEST 17: Turkish/Azeri
+TEST 18: Turkish/Azeri
 ============================================================
 ragıp hul^^fbsi ^^f6zdem
 ragip hul^^fbsi̇ ^^f6zdem
@@ -206,7 +211,7 @@ Ip hul^^fbsi ^^f6zdem
 Ip hul^^fbsi ^^f6zdem
 ============================================================
 ============================================================
-TEST 18: Lithuanian
+TEST 19: Lithuanian
 ============================================================
 i̇̀i̇́i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 ^^ec^^edĩìíĩj̀j́j̃į̀į́į̃
@@ -218,7 +223,7 @@ Ìi̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 İ̀i̇̀i̇̃i̇̀i̇́i̇̃j̇̀j̇́j̇̃į̇̀į̇́į̇̃
 ============================================================
 ============================================================
-TEST 19: Medieval Latin
+TEST 20: Medieval Latin
 ============================================================
 lupus
 lvpvs
@@ -226,7 +231,7 @@ LVPVS
 LUPUS
 ============================================================
 ============================================================
-TEST 20: Dutch
+TEST 21: Dutch
 ============================================================
 ijsselmeer
 ijsselmeer
@@ -242,13 +247,13 @@ Im
 Im
 ============================================================
 ============================================================
-TEST 21: Titlecase exceptions
+TEST 22: Titlecase exceptions
 ============================================================
 Ssoo
 Dž!
 ============================================================
 ============================================================
-TEST 22: Case changing braced arguments
+TEST 23: Case changing braced arguments
 ============================================================
 foo \emph {BAR} {baz}
 FOO \emph {BAR} {BAZ}
@@ -260,7 +265,7 @@ FOO \emph {BAR} {BAZ}
 \emph {BAR} {BAZ}
 ============================================================
 ============================================================
-TEST 23: Expanding content
+TEST 24: Expanding content
 ============================================================
 some text hello
 SOME TEXT HELLO
@@ -288,7 +293,7 @@ Some text \cs_tmp:w
 \cs_tmp:w  Sometext
 ============================================================
 ============================================================
-TEST 24: Math-mode escape
+TEST 25: Math-mode escape
 ============================================================
 some text $y = mx + c$
 SOME TEXT $y = mx + c$
@@ -304,7 +309,7 @@ Opps not close token in $y = mx + c
 Opps not close token in $y = mx + c
 ============================================================
 ============================================================
-TEST 25: Nesting
+TEST 26: Nesting
 ============================================================
 HELLO
 hello
@@ -312,7 +317,7 @@ FUSSBALL
 ὈΔΥΣΣΕΎΣ
 ============================================================
 ============================================================
-TEST 26: Letter-like commands
+TEST 27: Letter-like commands
 ============================================================
 \aa \aa \J \ae \dh \ss \l \o 
 \AA \AA \J \AE \DH \SS \L \O 
@@ -320,7 +325,7 @@ TEST 26: Letter-like commands
 \AA \aa \J \ae \dh \ss \l \O 
 ============================================================
 ============================================================
-TEST 27: Accents
+TEST 28: Accents
 ============================================================
 \"{a}\u {e}\H {i}\v {o}\.{u}
 \"{A}\u {E}\H {I}\v {O}\.{U}
@@ -328,7 +333,7 @@ TEST 27: Accents
 \"{A}\u {e}\H {i}\v {o}\.{u}
 ============================================================
 ============================================================
-TEST 28: Active chars
+TEST 29: Active chars
 ============================================================
 "`lo"=rem"'
 "`LO"=REM"'
@@ -336,7 +341,7 @@ TEST 28: Active chars
 "`Lo"=rem"'
 ============================================================
 ============================================================
-TEST 29: Case changing exclusions
+TEST 30: Case changing exclusions
 ============================================================
 Variant \tl_show:x already defined; not changing it on line ...
 > foo\NoCaseChange {BAR}.
@@ -347,7 +352,7 @@ l. ...  }
 l. ...  }
 ============================================================
 ============================================================
-TEST 30: Case change switching
+TEST 31: Case change switching
 ============================================================
 lower
 UPPER
@@ -359,7 +364,7 @@ Words UPPER
 Words \text_case_switch:nnnn {normal}{lower}{UPPER}{Title}
 ============================================================
 ============================================================
-TEST 31: Case change replacements
+TEST 32: Case change replacements
 ============================================================
 Defining \l__text_case_\foo_tl on line ...
 > fooreplaced.





More information about the latex3-commits mailing list.