Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ The sections do not signal obligations; the prefixes do.

## Unreleased

### Changed

- The variables of a scope (`define`/`in`) are visible only within its `in`.
Pointers outside the scope, such as later members of an enclosing group, do
not see them, and a variable defined with an outer variable's identifier
shadows it only within `in`. The description now says so ([#318]).
- Schemas: **ethdebug/format/pointer/collection/scope**
- Producers: no change needed. The text states the existing meaning; solc's
storage templates already depend on it.
- Consumers: required: a consumer that keeps a scope's variables after its
`in` must discard them there. `@ethdebug/pointers` does so from
[#317].

## 0.1.0-draft.1 — 2026-10-03

### Added
Expand Down Expand Up @@ -660,3 +673,5 @@ First published version of the specification.
[#303]: https://github.com/ethdebug/format/pull/303
[#305]: https://github.com/ethdebug/format/pull/305
[#309]: https://github.com/ethdebug/format/pull/309
[#317]: https://github.com/ethdebug/format/pull/317
[#318]: https://github.com/ethdebug/format/pull/318
4 changes: 3 additions & 1 deletion packages/web/docs/core-schemas/pointers/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ evaluates to a non-zero value.
## Scope

A **scope** defines variables that can be used in a nested pointer. Variables
are evaluated in order, so later variables can reference earlier ones.
are evaluated in order, so later variables can reference earlier ones. They are
visible only within `in`: pointers outside the scope, such as later members of
an enclosing group, do not see them.

Scopes help break complex pointer definitions into readable steps. For examples
combining scopes with keccak256 for storage slot computation, see the
Expand Down
5 changes: 5 additions & 0 deletions schemas/pointer/collection/scope.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ description: |
expression by identifier. Variables are specified **in order**, so that
later appearing variables may reference earlier ones in the same object.

The variables are visible only within `in`. Pointers outside this scope
do not see them: later members of an enclosing group, for example, see
only the variables of their own enclosing scopes. A variable defined here
with the same identifier as an outer variable shadows it within `in`.

type: object

properties:
Expand Down
Loading