Skip to content
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

refactor: constant folding #3719

Merged

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Jan 7, 2024

What I did

How I did it

How to verify it

Commit message

refactor constant folding into a visitor class, clean up a couple passes

this moves responsibility for knowing how to fold a node off the
individual AST node implementations and into the ConstantFolder visitor.

by adding a dependency to get_namespace() it also makes constant folding
more generic; soon we can rely on more things being in the global
namespace at constant folding time.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2024

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (a1fd228) 84.21% compared to head (92fff06) 84.11%.

Files Patch % Lines
vyper/semantics/analysis/pre_typecheck.py 80.43% 14 Missing and 13 partials ⚠️
vyper/semantics/types/module.py 25.00% 6 Missing ⚠️
vyper/semantics/types/user.py 14.28% 6 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3719      +/-   ##
==========================================
- Coverage   84.21%   84.11%   -0.11%     
==========================================
  Files          92       92              
  Lines       13077    13109      +32     
  Branches     2916     2921       +5     
==========================================
+ Hits        11013    11026      +13     
- Misses       1646     1663      +17     
- Partials      418      420       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@charles-cooper charles-cooper marked this pull request as ready for review January 9, 2024 17:21
Copy link
Collaborator

@tserg tserg left a comment

Choose a reason for hiding this comment

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

Two small comments, otherwise LGTM!

vyper/ast/nodes.py Outdated Show resolved Hide resolved
vyper/semantics/types/module.py Outdated Show resolved Hide resolved
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