-
Notifications
You must be signed in to change notification settings - Fork 0
feat: support literal string map pattern keys #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tiye
merged 3 commits into
test/embedding-api-contract
from
feat/string-map-pattern-keys
Aug 23, 2026
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # RFC 0090:映射解构的字面字符串键 | ||
|
|
||
| - 状态:已采纳 | ||
| - 依赖:RFC 0012、RFC 0023、RFC 0075 | ||
|
|
||
| ## 动机 | ||
|
|
||
| QuickCoffee 的映射字面量允许任意字符串键,但映射解构过去只接受标识符键。这样无法 | ||
| 解构外部数据常见的 `first-name`、`content-type` 等键,也使“映射键是字符串”与“映射 | ||
| 解构键必须是标识符”产生不必要的不对称。 | ||
|
|
||
| ## 契约 | ||
|
|
||
| 映射模式的键可以是标识符或已解码的非插值字符串字面量: | ||
|
|
||
| ```coffee | ||
| {"first-name": first} = {"first-name": "Ada"} | ||
| ``` | ||
|
|
||
| 字符串键按字面值查找,不执行插值、名称读取或其他表达式;动态 computed key 仍不支持。 | ||
| 重命名、默认值、递归模式、末尾 map rest 和原子匹配规则保持 RFC 0012、0023、0075 不变。 | ||
| 非法缺键、类型错误和模式失败仍不会留下部分绑定。 | ||
|
|
||
| ## 验收 | ||
|
|
||
| `tests/rfc_core.rs` 覆盖连字符字符串键、单引号键、缺键错误和成功绑定;双语语法索引必须 | ||
| 区分字面字符串键与未支持的 computed key。现有验证器与 VM 指令无需新增,`make check` 仍 | ||
| 执行完整回归与五份文学手册。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.