Skip to content

Module level const support #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 7, 2021

Conversation

cburgdorf
Copy link
Collaborator

@cburgdorf cburgdorf commented Sep 6, 2021

What was wrong?

We currently do not yet support constant values (see #192)

How was it fixed?

This PR adds support for const on the module level but only for base types. I also have some WIP code to also support complex types but since base types can simply be inlined (no point in wasting gas to read them from the code) we can handle support for these constants entirely at the lowering stage which is what this PR does.

To-Do

  • OPTIONAL: Update Spec if applicable
  • Add entry to the release notes (may forgo for trivial changes)

@cburgdorf cburgdorf force-pushed the christoph/feat/constants branch from 64f4a6e to 49ed5e4 Compare September 6, 2021 15:27
@codecov-commenter
Copy link

Codecov Report

Merging #536 (49ed5e4) into master (466d4b5) will decrease coverage by 0.38%.
The diff coverage is 3.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #536      +/-   ##
==========================================
- Coverage   87.67%   87.29%   -0.39%     
==========================================
  Files          87       87              
  Lines        5672     5697      +25     
==========================================
  Hits         4973     4973              
- Misses        699      724      +25     
Impacted Files Coverage Δ
crates/parser/src/ast.rs 62.90% <0.00%> (-1.04%) ⬇️
crates/parser/src/grammar/module.rs 66.34% <4.00%> (-19.91%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 466d4b5...49ed5e4. Read the comment docs.

@cburgdorf cburgdorf force-pushed the christoph/feat/constants branch 2 times, most recently from 5dcde97 to fd1e009 Compare October 6, 2021 16:23
@cburgdorf cburgdorf force-pushed the christoph/feat/constants branch from fd1e009 to 02d9f11 Compare October 7, 2021 10:33
@cburgdorf cburgdorf force-pushed the christoph/feat/constants branch from 02d9f11 to a02c900 Compare October 7, 2021 10:43
@cburgdorf cburgdorf force-pushed the christoph/feat/constants branch from a02c900 to ae09c7a Compare October 7, 2021 10:56
@cburgdorf cburgdorf marked this pull request as ready for review October 7, 2021 10:56
@cburgdorf cburgdorf requested a review from g-r-a-n-t October 7, 2021 11:12
Copy link
Collaborator

@sbillig sbillig left a comment

Choose a reason for hiding this comment

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

LGTM

@sbillig sbillig merged commit 262a20a into ethereum:master Oct 7, 2021
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.

4 participants