Skip to content

[1032] 适配与修复 (liii match) 中的反引号及拼接模式匹配 - #1089

Merged
da-liii merged 2 commits into
mainfrom
da/1032/quasiquote_match
Oct 9, 2026
Merged

da-liii merged 2 commits into
mainfrom
da/1032/quasiquote_match

Conversation

@da-liii

@da-liii da-liii commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What

  1. 适配 S7 Scheme 底层反引号 AST 表示形式,包括 #_list-values、#_apply-values 以及 #_<list*>;
  2. 修复 match-core.scm 中 match-two、match-quasiquote、match-extract-vars 及 match-extract-quasiquote-vars 对反引号模式及拼接模式的解构逻辑;
  3. 新增 match-list-values 与 match-list-star 宏体系,支持单一解引用、多重解引用、尾部与非尾部拼接解引用、点对反引号等;
  4. 完善 tests/liii/match/match-test.scm 测试用例,覆盖各种反引号模式解构与变量提取。

Why

解决 Issue #1086 中 (liii match) quasiquote 失效问题,提供符合开发者直觉的模式匹配体验。

How

排查并适配 S7 reader 在读取期生成的反引号内部 AST 结构,精准拦截与分发匹配规则并完成变量提取。

Test

  • xmake b goldfish
  • bin/gf fmt --changed-since=main
  • bin/gf test --changed-since=main
  • bin/gf tests/liii/match/match-test.scm (70 correct, 0 failed)
  • bin/gf test --all (1672/1672 PASS)

@da-liii
da-liii force-pushed the da/1032/quasiquote_match branch from 93bb1b5 to d931302 Compare October 9, 2026 06:59
@da-liii
da-liii merged commit 3fdac16 into main Oct 9, 2026
5 checks passed
@da-liii
da-liii deleted the da/1032/quasiquote_match branch October 9, 2026 07:08
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