Skip to content

[1127] TMU 序列化迁移到 moebius#3844

Merged
da-liii merged 5 commits into
mainfrom
da/1127/tmu
Jun 27, 2026
Merged

[1127] TMU 序列化迁移到 moebius#3844
da-liii merged 5 commits into
mainfrom
da/1127/tmu

Conversation

@da-liii

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

Copy link
Copy Markdown
Contributor

Summary

将 TMU 序列化/反序列化从 src/Data/Convert/Mogan/ 下沉到 moebius/Data/Convert/,延续 [1124]/[1126] 的「主工程 → moebius/lolly」剥离方向。

  • 新增 moebius/Data/Convert/tmu.{hpp,cpp}:合并自 from_tmu.cpp + to_tmu.cpp,导出 tmu_to_tree / tmu_to_tree(version) / tmu_document_to_tree / tree_to_tmu
  • get_codes 连同其 helper(rename_feature/new_feature)内联为 static,随 tmu 一并下沉。
  • is_snippet 收口到 moebius Data/Tree/tree_helper,主工程 convert.hpp 改为转发,generic.cpp 删本地实现。
  • convert.hpp 的 TMU 三函数声明改为 #include "tmu.hpp",glue_convert.lua 无需改动。
  • 删除 src/Data/Convert/Mogan/from_tmu.cpp + to_tmu.cpp(连同空目录),顺手清理 from_tmu 顶部无用的 #include "preferences.hpp"

边界处理

XMACS_VERSION/TEXMACS_VERSION 由主工程 tm_configure.hpp 注入,moebius 编译单元看不到。在 tmu.cpp 顶部用 #ifndef 给占位定义。占位值不影响运行时:单参 tmu_reader 构造直接用 STD_CODE(不调 get_codes),双参构造的 version 来自文件头解析的真实版本号。后续可单独 PR 把版本号参数化。

Test plan

  • xmake b libmoebius
  • xmake b stem(含 glue_convert 生成与链接)
  • xmake b convert_test && xmake r convert_test —— 4 passed
  • gf fmt --changed-since=main —— 0 改动

🤖 Generated with Claude Code

da-liii added 5 commits June 27, 2026 19:28
记录 What/Why/How 与涉及文件清单,作为本 PR 第一个 commit。
将 from_tmu.cpp + to_tmu.cpp 合并为 moebius/Data/Convert/tmu.cpp,
声明收入 tmu.hpp。get_codes 连同其 helper 内联为 static,is_snippet
收口到 moebius tree_helper,主工程 convert.hpp 改为转发。删除
src/Data/Convert/Mogan/ 下的两个旧文件,顺手清理 from_tmu 顶部
无用的 preferences.hpp include。
把 tmu.cpp 里 XMACS_VERSION/TEXMACS_VERSION 的 #ifndef 占位值从
"0.0.0" 改为主工程当前真实版本,主工程升级时需同步。同步更新
devel/1127.md 的说明。
按 lolly 的合并模式,把 moebius 的构建/测试并入 ci-debian13 /
ci-fedora / ci-macos-arm64 / ci-xmake-windows:paths 加入 moebius
路径,paths-filter 增加 moebius/moebius_src 过滤器,cache key 的
hashFiles 追加 moebius/xmake.lua,新增 build/test moebius 步骤,
主构建步骤的触发条件纳入 moebius_src。ci-fedora 此前连 lolly 都
未合并,一并补齐 lolly+moebius。删除独立的 ci-moebius-*.yml。
@da-liii da-liii merged commit 9c12af7 into main Jun 27, 2026
4 checks passed
@da-liii da-liii deleted the da/1127/tmu branch June 27, 2026 13:01
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