support Solidity 0.8.29 and custom storage layouts#1288
Merged
OmarTawfik merged 3 commits intoNomicFoundation:mainfrom Mar 26, 2025
Merged
support Solidity 0.8.29 and custom storage layouts#1288OmarTawfik merged 3 commits intoNomicFoundation:mainfrom
0.8.29 and custom storage layouts#1288OmarTawfik merged 3 commits intoNomicFoundation:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 86f318b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
To support the new [Custom Storage Layout](https://docs.soliditylang.org/en/v0.8.29/contracts.html#custom-storage-layout) language feature, `ContractDefinition` nodes will no longer have an optional `InheritanceSpecifier` child directly, but will hold a list of `ContractSpecifier` children, that can either be `InheritanceSpecifier` or `StorageLayoutSpecifier`. Closes NomicFoundation#1282 Additionally, the new grammar resurfaces the same issue as NomicFoundation#862 for call options during error recovery, so I fixed the parser codegen as well.
99da2e8 to
4c62e48
Compare
ggiraldez
reviewed
Mar 24, 2025
Contributor
ggiraldez
left a comment
There was a problem hiding this comment.
I left a couple of non-blocking questions/suggestions, but otherwise looks good to me.
crates/codegen/runtime/generator/src/parser/codegen/parser_definition.rs
Outdated
Show resolved
Hide resolved
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 10, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @nomicfoundation/slang@1.1.0 ### Minor Changes - [#1288](#1288) [`2090ab8`](2090ab8) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - support Solidity `0.8.29` and [Custom Storage Layouts](https://docs.soliditylang.org/en/v0.8.29/contracts.html#custom-storage-layout): - `ContractDefinition` nodes will no longer have an optional `InheritanceSpecifier` child directly, but will hold a list of `ContractSpecifier` children - `ContractSpecifier` nodes have either `InheritanceSpecifier` or `StorageLayoutSpecifier` children - [#1265](#1265) [`2312260`](2312260) Thanks [@mjoerussell](https://github.com/mjoerussell)! - Add `LanguageUtils::infer_language_versions(source_code) -> Version[]` API, which will analyze version pragmas inside a source file, and return a list of supported language versions that they allow. This can be used to select a valid language version to use with the rest of Slang APIs. Please see the [Choosing a Solidity Version](https://nomicfoundation.github.io/slang/1.1.0/user-guide/04-getting-started/02-choosing-a-solidity-version/) guide for more information. ### Patch Changes - [#1291](#1291) [`da1f863`](da1f863) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Resolve arguments to inheritance specifiers and expressions in storage layout specifiers using the contract's parent scope. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
rollup-smithbm0p
added a commit
to rollup-smithbm0p/slang
that referenced
this pull request
Dec 26, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @nomicfoundation/slang@1.1.0 ### Minor Changes - [#1288](NomicFoundation/slang#1288) [`2090ab8`](NomicFoundation/slang@2090ab8) Thanks [@OmarTawfik](https://github.com/OmarTawfik)! - support Solidity `0.8.29` and [Custom Storage Layouts](https://docs.soliditylang.org/en/v0.8.29/contracts.html#custom-storage-layout): - `ContractDefinition` nodes will no longer have an optional `InheritanceSpecifier` child directly, but will hold a list of `ContractSpecifier` children - `ContractSpecifier` nodes have either `InheritanceSpecifier` or `StorageLayoutSpecifier` children - [#1265](NomicFoundation/slang#1265) [`2312260`](NomicFoundation/slang@2312260) Thanks [@mjoerussell](https://github.com/mjoerussell)! - Add `LanguageUtils::infer_language_versions(source_code) -> Version[]` API, which will analyze version pragmas inside a source file, and return a list of supported language versions that they allow. This can be used to select a valid language version to use with the rest of Slang APIs. Please see the [Choosing a Solidity Version](https://nomicfoundation.github.io/slang/1.1.0/user-guide/04-getting-started/02-choosing-a-solidity-version/) guide for more information. ### Patch Changes - [#1291](NomicFoundation/slang#1291) [`da1f863`](NomicFoundation/slang@da1f863) Thanks [@ggiraldez](https://github.com/ggiraldez)! - Resolve arguments to inheritance specifiers and expressions in storage layout specifiers using the contract's parent scope. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.
To support the new Custom Storage Layout language feature,
ContractDefinitionnodes will no longer have an optionalInheritanceSpecifierchild directly, but will hold a list ofContractSpecifierchildren, that can either beInheritanceSpecifierorStorageLayoutSpecifier.Closes #1282
Additionally, the new grammar resurfaces the same issue as #862 for call options during error recovery, so I fixed the parser codegen as well.