docs: document word("...") and event("...") constant syntax in code_organization.md
#2,688 opened on Feb 13, 2026
Repository metrics
- Stars
- (753 stars)
- PR merge metrics
- (Avg merge 6d 2h) (71 merged PRs in 30d)
Description
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("...").