Repository navigation
format: switch the pointer expression sigil from $ to ~ - #323
Merged
Merged
Conversation
Contributor
|
gnidan
force-pushed
the
architect-tilde-sigil
branch
2 times, most recently
from
October 5, 2026 20:34
c777057 to
383cdf1
Compare
gnidan
force-pushed
the
architect-tilde-sigil
branch
2 times, most recently
from
October 5, 2026 23:13
5a761d4 to
5ada108
Compare
gnidan
force-pushed
the
architect-tilde-sigil
branch
from
October 5, 2026 23:15
5ada108 to
cbf1ea0
Compare
The format's own pointer vocabulary (~wordsize, ~this, ~sum, ~difference, ~product, ~quotient, ~remainder, ~read, ~keccak256, ~concat, ~wordsized, ~sized<N>) now uses the ~ sigil instead of $, so a source-language name that starts with $ cannot collide with a format term. The identifier schema now says why an identifier may not start with ~. The schemas, the @ethdebug/format types and guards, the @ethdebug/pointers evaluator, and bugc's pointer emission change together: each depends on the others to build and pass its tests.
gnidan
force-pushed
the
architect-tilde-sigil
branch
from
October 8, 2026 00:10
cbf1ea0 to
73691fa
Compare
gnidan
marked this pull request as ready for review
October 8, 2026 00:19
djolertrk
added a commit
to walnuthq/soldb
that referenced
this pull request
Oct 8, 2026
ethdebug/format 0.1.0-draft.2 spells its pointer expression terms with `~` instead of `$` (ethdebug/format#323) and lets identifiers start with `$` (ethdebug/format#325), and solc follows it. Read `~sum`, `~read`, `~wordsize`, `~this` and the other terms, and accept names starting with `$`, so a struct member such as `$member` is found as it is. Released compilers still write `$sum` and the like, so the `$` spelling is still read as the term wherever a name cannot be meant: as an expression key, and as `$wordsize` and `$this`, which no compiler names a variable or a region. The fixture is regenerated with the stamp and the `~` terms, and the pointer lit test accepts either spelling.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The format's own terms inside pointer expressions now start with
~instead of$. Solidity allows identifiers that start with$, and compilers want to use source names as they are in pointer output (region, variable and template names), so a source variable named$wordsizecould collide with the format's"$wordsize"(#310).Why
~: it cannot start an identifier in Solidity, Yul, Vyper or Fe, so no source name can collide with a format term. YAML reads~sum:or- ~wordsizeas plain strings (only a lone~is null), so the schemas and examples need no quoting. JSON Pointer has a defined escape for it (~0), so a$refor an error path into an expression stays unambiguous.The terms that change are the constants and references
~wordsizeand~this, and the operators~sum,~difference,~product,~quotient,~remainder,~read,~keccak256,~concat,~wordsizedand~sized<N>. JSON Schema keywords ($ref,$id,$defs,$dynamicRefand so on) are unaffected.ethdebug/format/pointer/identifier now says why a name must not start with
~; its pattern does not change. Allowing a leading$in identifiers is split out into #325, which stacks on this PR and must merge after it.This is breaking for producers and consumers, with no compatibility path. Producers must emit the
~terms; the$ones no longer validate. Consumers must read the~terms; the$spellings are no longer format terms. The reference implementation moves with the schemas: the@ethdebug/formattypes and guards, the@ethdebug/pointersevaluator, and every pointer bugc emits (including the storage string and mapping entry templates and the calldata slice regions that landed since this PR opened) all use~. The docs site and the Unreleased changelog entries follow; released entries are unchanged.@ethdebug/pointersdoes not accept$as a deprecated alias. Once #325 lets a name start with$, an alias would make"$wordsize"mean two things, which is the collision this change removes. When an invalid expression uses a$spelling, the error suggests the~one.The published
@ethdebug/pointers@0.1.0-preview.1depends on@ethdebug/format@^0.1.0-draft.1, a range that accepts the next draft, so it can be installed beside the new format and then misreads~data; the release must handle that.Producers that emit pointer expressions must switch: solc (via Walnut's fork), Solar if it emits expressions, and bugc (done here). Until solc emits
~, the solc conformance tests translate a copy of solc's programs and resources to~before schema validation (withSolcTildeVocabularyinpackages/conformance/test/conformance.test.ts, tracked in #324), next to the existing resources stamp workaround (#311). The libraries do not translate anything. SolDB still reads solc's original output. The translation fails with a "remove withSolcTildeVocabulary" message as soon as solc emits a~term.Closes #310