docs: document word("...") and event("...") constant syntax in code_organization.md
#2,688 建立於 2026年2月13日
倉庫指標
- 星標
- (753 顆星)
- PR 合併指標
- (平均合併 6天 2小時) (30 天內合併 71 個 PR)
描述
The word("...") and event("...") constant constructors are supported by the assembler (defined in the LALRPOP grammar at crates/assembly-syntax/src/parser/grammar.lalrpop, with HashKind::Word and HashKind::Event in crates/assembly-syntax/src/ast/constants/expr.rs), but they are not documented in the code organization reference (docs/src/user_docs/assembly/code_organization.md).
The "Word constants" section documents array syntax ([1,2,3,4]) and hex format but does not mention the word("string") constructor, which hashes the provided string via Blake3 to derive a deterministic Word. Similarly, event("string") derives a single field element.
These constructors are widely used in Miden account programs for named storage slot IDs and event identifiers, and should be documented alongside the other word constant forms.
Suggested change: Add a "Word constants from strings" subsection after the "Constant slices" section, showing the word("...") syntax with slice notation, and mentioning event("...").