Skip to content

Commit

Permalink
fix implements stmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Oct 24, 2023
1 parent e2f1c8c commit 733b510
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
16 changes: 0 additions & 16 deletions vyper/ast/expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@
from vyper.semantics.types.function import ContractFunctionT


def expand_annotated_ast(vyper_module: vy_ast.Module) -> None:
"""
Perform expansion / simplification operations on an annotated Vyper AST.
This pass uses annotated type information to modify the AST, simplifying
logic and expanding subtrees to reduce the compexity during codegen.
Arguments
---------
vyper_module : Module
Top-level Vyper AST node that has been type-checked and annotated.
"""
generate_public_variable_getters(vyper_module)
remove_unused_statements(vyper_module)


def generate_public_variable_getters(vyper_module: vy_ast.Module) -> None:
"""
Create getter functions for public variables.
Expand Down
1 change: 1 addition & 0 deletions vyper/compiler/phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def generate_folded_ast(
StorageLayout
Layout of variables in storage
"""
vy_ast.expansion.remove_unused_statements(vyper_module)
vyper_module_folded = copy.deepcopy(vyper_module)
vy_ast.folding.fold(vyper_module_folded)
symbol_tables = set_data_positions(vyper_module_folded, storage_layout_overrides)
Expand Down
2 changes: 1 addition & 1 deletion vyper/semantics/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ def validate_semantics(vyper_ast, interface_codes):

with namespace.enter_scope():
add_module_namespace(vyper_ast, interface_codes)
vy_ast.expansion.expand_annotated_ast(vyper_ast)
vy_ast.expansion.generate_public_variable_getters(vyper_ast)
validate_functions(vyper_ast)

0 comments on commit 733b510

Please sign in to comment.