Skip to content

feat(slang): modifiers - #698

Merged
hedgar2017 merged 4 commits into
mainfrom
az-slang-modifiers
Sep 28, 2026
Merged

hedgar2017 merged 4 commits into
mainfrom
az-slang-modifiers

Conversation

@hedgar2017

@hedgar2017 hedgar2017 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Lowers modifiers in the Slang frontend: modifier definitions, invocation regions evaluating their arguments, the placeholder, and Slang's answer for which modifier an entry runs when the compiled contract dispatches it.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Coverage Summary

Crate Line Coverage Function Coverage
solx 🟢 83.6% 🔴 20.0%
solx-benchmark-converter 🔴 0.0% 🔴 0.0%
solx-codegen-evm 🟡 55.9% 🔴 48.4%
solx-compiler-downloader 🔴 0.0% 🔴 0.0%
solx-core 🔴 46.9% 🟡 53.9%
solx-dev 🔴 3.2% 🔴 4.2%
solx-mlir 🟡 50.7% 🔴 46.3%
solx-slang 🔴 22.3% 🔴 30.1%
solx-solc-test-adapter 🔴 1.7% 🔴 2.1%
solx-standard-json 🔴 40.7% 🔴 44.6%
solx-tester 🔴 36.6% 🔴 34.6%
solx-utils 🔴 32.2% 🔴 36.7%
Total 🔴 12.8% 🔴 15.9%

Codecov Report | HTML Report | Workflow Run

@hedgar2017
hedgar2017 force-pushed the az-slang-modifiers branch 2 times, most recently from 7697cac to 9f48b04 Compare September 9, 2026 16:04
@hedgar2017
hedgar2017 force-pushed the az-slang-inheritance branch 2 times, most recently from 28da541 to 7fb3184 Compare September 9, 2026 22:15
@hedgar2017
hedgar2017 force-pushed the az-slang-inheritance branch 10 times, most recently from 67d6b7c to ffeabbf Compare September 19, 2026 14:34
@hedgar2017
hedgar2017 force-pushed the az-slang-modifiers branch 2 times, most recently from faa76df to 8e9807a Compare September 19, 2026 21:29
@hedgar2017
hedgar2017 force-pushed the az-slang-inheritance branch 3 times, most recently from 3c3bc9d to 19841ef Compare September 22, 2026 11:34
Base automatically changed from az-slang-inheritance to main September 23, 2026 21:05
@hedgar2017
hedgar2017 force-pushed the az-slang-modifiers branch 2 times, most recently from f09feac to be7b53f Compare September 24, 2026 13:42
@hedgar2017
hedgar2017 marked this pull request as ready for review September 24, 2026 13:42
@hedgar2017
hedgar2017 force-pushed the az-slang-modifiers branch 5 times, most recently from f0e294a to 55a3c9a Compare September 24, 2026 15:31

@ggiraldez ggiraldez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestions for code readability, but looks good to me as far as Slang lowering goes.

Comment thread solx-slang/src/contract/function/mod.rs
Comment thread solx-slang/src/scope/contract.rs Outdated

@abinavpp abinavpp left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Could add to a lit test: a modifier with two _;, a modifier invocation whose argument is an expression rather than a bare identifier, and a modifier on a function returning two values.

Lowers modifiers in the Slang frontend: a `sol.modifier` defined at the first invocation naming it, `sol.modifier_invocation` regions evaluating the arguments in each modified function's entry block after its base-constructor call, and `sol.placeholder` for `_`. Which modifier an entry runs is Slang's answer, so a bare name runs the modifier the compiled contract dispatches and a qualified one the declaration.

Pins Slang to the head of NomicFoundation/slang#2178.
@hedgar2017

Copy link
Copy Markdown
Contributor Author

LGTM. Could add to a lit test: a modifier with two _;, a modifier invocation whose argument is an expression rather than a bare identifier, and a modifier on a function returning two values.

Thanks, added!

@hedgar2017 hedgar2017 self-assigned this Sep 28, 2026
@hedgar2017
hedgar2017 added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit c3eb66b Sep 28, 2026
44 checks passed
@hedgar2017
hedgar2017 deleted the az-slang-modifiers branch September 28, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants