Skip to content

[1113] 将 herk_to_utf8 与 utf8_to_herk 迁移到 lolly#3815

Merged
da-liii merged 6 commits into
mainfrom
da/1113/herk
Jun 25, 2026
Merged

[1113] 将 herk_to_utf8 与 utf8_to_herk 迁移到 lolly#3815
da-liii merged 6 commits into
mainfrom
da/1113/herk

Conversation

@da-liii

@da-liii da-liii commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

摘要

herk_to_utf8utf8_to_herk 的实现从 src/Data/String/converter.cpp 迁移到 lolly/lolly/data/herk.cpp,并把对应的 Scheme glue 从 glue_moebius.lua 迁移到 glue_lolly.lua

主要改动

  • 新增 lolly/lolly/data/herk.hpp / herk.cpp,在 lolly::data 命名空间中提供 herk_to_utf8utf8_to_herk
  • src/Data/String/converter.cpp 删除重复映射表与实现,保留为对 lolly::data 的薄封装,现有 C++ 调用点无需修改。
  • src/Scheme/L2/glue_lolly.lua 增加 utf8->herkherk->utf8 绑定到 lolly::data 函数。
  • src/Scheme/L3/glue_moebius.lua 移除对应的 glue 条目。
  • src/Scheme/L2/init_glue_l2.cpp 增加 #include <lolly/data/herk.hpp>
  • 新增 lolly/tests/lolly/data/herk_test.cpp,覆盖 Herk/UTF-8 双向转换、转义序列、CJK 与边界情况。
  • 更新 devel/1113.md 任务文档。

测试计划

  • xmake b lolly_tests && xmake test lolly_tests/herk_test 通过
  • xmake b converter_test && xmake r converter_test 通过(6/6)
  • xmake b stem 构建成功
  • gf fmt 无变更

🤖 Generated with Claude Code

da-liii and others added 6 commits June 25, 2026 20:43
更新 devel/1113.md,记录 herk_to_utf8/utf8_to_herk 迁移到
lolly/lolly/data 以及对应 glue 从 glue_moebius 迁移到 glue_lolly
的计划与验证命令。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 在 lolly/lolly/data/herk.hpp 与 herk.cpp 中实现 lolly::data::herk_to_utf8
  与 lolly::data::utf8_to_herk,使用硬编码映射表。
- src/Data/String/converter.cpp 保留为对 lolly::data 的薄封装。
- 将 Scheme glue 从 glue_moebius.lua 迁移到 glue_lolly.lua。
- 在 init_glue_l2.cpp 中 include <lolly/data/herk.hpp>。
- 新增 lolly/tests/lolly/data/herk_test.cpp。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
将 herk_test.cpp 中的查表实现相关测试改为基于显式
UTF-8 字节序列与往返转换的朴素用例。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
按字节分组(herk_0x .. herk_Fx),用显式 Unicode 字符
直接描述 herk_to_utf8 的期望输出;对 invisible 或易混淆
字符保留 \\xHH 转义,并补充 escape、named escape 与未映射
字符的用例。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
按 Unicode 码点范围分组(0x..Fx 与 high mapped/unmapped),
用显式 UTF-8 字节序列直接描述 utf8_to_herk 的期望输出;
覆盖 0x00..0xFF 全部码点、所有高位映射及常见未映射字符。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
改用 lolly::data::utf8_to_herk / lolly::data::herk_to_utf8 直接调用。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@da-liii da-liii merged commit b7774d6 into main Jun 25, 2026
11 checks passed
@da-liii da-liii deleted the da/1113/herk branch June 25, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant