From 4c9c7e49cd07c57c2d3ecd8eb76c1ceb3345fe83 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 24 Aug 2023 14:11:50 -0500 Subject: [PATCH 1/3] =?UTF-8?q?feat(resources):=20add=20pcm=20keyboard=20?= =?UTF-8?q?=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - keyman side of https://github.com/unicode-org/cldr/pull/3123 - validating that tests pass #7042 --- core/tests/unit/ldml/keyboards/meson.build | 1 + .../ldml-keyboards/techpreview/3.0/pcm.xml | 70 +++++++++++++++++++ .../techpreview/test/pcm-test.xml | 14 ++++ 3 files changed, 85 insertions(+) create mode 100644 resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml create mode 100644 resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml diff --git a/core/tests/unit/ldml/keyboards/meson.build b/core/tests/unit/ldml/keyboards/meson.build index fb00cddecd8..4bce343bd30 100644 --- a/core/tests/unit/ldml/keyboards/meson.build +++ b/core/tests/unit/ldml/keyboards/meson.build @@ -11,6 +11,7 @@ tests_from_cldr = [ 'ja-Latn', 'pt-t-k0-abnt2', 'fr-t-k0-azerty', + 'pcm', ] tests_without_testdata = [ diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml new file mode 100644 index 00000000000..aa5376f21e2 --- /dev/null +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml new file mode 100644 index 00000000000..5ae1725fa11 --- /dev/null +++ b/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + From 0f07caa7d6589fc366218af8cb1c2d961edeaa86 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 24 Aug 2023 14:35:41 -0500 Subject: [PATCH 2/3] =?UTF-8?q?feat(core):=20support=20\u{=E2=80=A6}=20esc?= =?UTF-8?q?apes=20in=20test=20data=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #7042 --- core/tests/unit/ldml/ldml_test_source.cpp | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/tests/unit/ldml/ldml_test_source.cpp b/core/tests/unit/ldml/ldml_test_source.cpp index 673f692f1e0..507468efaa1 100644 --- a/core/tests/unit/ldml/ldml_test_source.cpp +++ b/core/tests/unit/ldml/ldml_test_source.cpp @@ -109,10 +109,16 @@ LdmlTestSource::parse_source_string(std::string const &s) { if (*p == '\\') { p++; km_kbp_usv v; + bool had_open_curly = false; assert(p != s.end()); if (*p == 'u' || *p == 'U') { // Unicode value p++; + if (*p == '{') { + p++; + assert(p != s.end()); + had_open_curly = true; + } size_t n; std::string s1 = s.substr(p - s.begin(), 8); v = std::stoul(s1, &n, 16); @@ -125,6 +131,12 @@ LdmlTestSource::parse_source_string(std::string const &s) { t += km_kbp_cp(Uni_UTF32ToSurrogate1(v)); t += km_kbp_cp(Uni_UTF32ToSurrogate2(v)); } + if (had_open_curly) { + p++; + // close what you opened + assert(*p == '}'); // close curly + assert(p != s.end()); + } } else if (*p == 'd') { // Deadkey // TODO, not yet supported @@ -146,10 +158,16 @@ LdmlTestSource::parse_u8_source_string(std::string const &u8s) { if (*p == '\\') { p++; km_kbp_usv v; + bool had_open_curly = false; assert(p != s.end()); if (*p == 'u' || *p == 'U') { // Unicode value p++; + if (*p == '{') { + p++; + assert(p != s.end()); + had_open_curly = true; + } size_t n; std::u16string s1 = s.substr(p - s.begin(), 8); // TODO-LDML: convert back first? @@ -164,6 +182,12 @@ LdmlTestSource::parse_u8_source_string(std::string const &u8s) { t += km_kbp_cp(Uni_UTF32ToSurrogate1(v)); t += km_kbp_cp(Uni_UTF32ToSurrogate2(v)); } + if (had_open_curly) { + p++; + // close what you opened + assert(*p == '}'); // close curly + assert(p != s.end()); + } } else if (*p == 'd') { // Deadkey // TODO, not yet supported From c7b6787e67fae7a39ac887a77c8623d969d735b7 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 24 Aug 2023 14:40:37 -0500 Subject: [PATCH 3/3] =?UTF-8?q?feat(resources):=20add=20pcm=20keyboard=20?= =?UTF-8?q?=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - simplify, drop normalization entries - update test --- .../ldml-keyboards/techpreview/3.0/pcm.xml | 110 ++++++++---------- .../techpreview/test/pcm-test.xml | 27 +++-- 2 files changed, 66 insertions(+), 71 deletions(-) diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml index aa5376f21e2..5796575ee85 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml @@ -1,70 +1,58 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - - - + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml index 5ae1725fa11..88fc500091e 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml @@ -1,14 +1,21 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + +