Skip to content

feat: support literal string map pattern keys - #22

Merged
tiye merged 3 commits into
test/embedding-api-contractfrom
feat/string-map-pattern-keys
Aug 23, 2026
Merged

feat: support literal string map pattern keys#22
tiye merged 3 commits into
test/embedding-api-contractfrom
feat/string-map-pattern-keys

Conversation

@tiye

@tiye tiye commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

  • add RFC 0090 for literal string keys in map destructuring
  • accept single- and double-quoted non-interpolated keys while keeping computed keys rejected
  • preserve strict atomic matching, defaults, renaming, and map rest semantics
  • add core regression tests and update English/Chinese syntax indexes

Validation

  • make check
  • `make docs && git diff --exit-code -- "docs/manual*.html"

No new VM instruction is required; keys are lowered to the existing map pattern representation.

Copilot AI lite review requested due to automatic review settings August 22, 2026 13:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends QuickCoffee’s map destructuring (pattern matching on {...}) to accept literal string keys (single- or double-quoted) in addition to identifier keys, aligning pattern syntax with map literal capabilities while continuing to reject computed/interpolated keys.

Changes:

  • Parser: allow Token::String keys in map destructuring patterns, rejecting interpolated (computed) string keys.
  • Tests: add regression coverage for successful binding and failure cases with literal string keys.
  • Docs/RFCs: add RFC 0090 and update English/Chinese syntax indexes plus README RFC range.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/rfc_core.rs Adds regression tests for literal string keys in map destructuring (success + error cases).
src/parser.rs Extends map-pattern key parsing to accept literal string tokens while rejecting computed/interpolated keys.
RFCs/0090-string-map-pattern-keys.md New RFC documenting the contract and acceptance criteria for literal string map-pattern keys.
README.md Updates the “RFCs range” link to include RFC 0090.
docs/syntax.zh-CN.md Updates the Chinese syntax index to document literal string keys in map destructuring and exclude computed keys.
docs/syntax.en.md Updates the English syntax index to document literal string keys in map destructuring and exclude computed keys.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/parser.rs Outdated
@tiye
tiye merged commit 1434269 into test/embedding-api-contract Aug 23, 2026
2 checks passed
@tiye
tiye deleted the feat/string-map-pattern-keys branch August 23, 2026 04:07
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.

2 participants