Skip to content

Commit

Permalink
clean up prefold
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Nov 14, 2023
1 parent 0bfaf2f commit 78bad6c
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions vyper/semantics/analysis/pre_typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,7 @@ def pre_typecheck(node: vy_ast.Module):


def prefold(node: vy_ast.VyperNode, constants: dict) -> None:
if isinstance(node, vy_ast.BinOp):
node._metadata["folded_value"] = node.prefold()

if isinstance(node, vy_ast.UnaryOp):
node._metadata["folded_value"] = node.prefold()

if isinstance(node, vy_ast.Compare):
node._metadata["folded_value"] = node.prefold()

if isinstance(node, vy_ast.BoolOp):
node._metadata["folded_value"] = node.prefold()

if isinstance(node, vy_ast.Subscript):
node._metadata["folded_value"] = node.prefold()

if isinstance(node, vy_ast.List):
if isinstance(node, (vy_ast.BinOp, vy_ast.BoolOp, vy_ast.Compare, vy_ast.List, vy_ast.Subscript, vy_ast.UnaryOp)):
node._metadata["folded_value"] = node.prefold()

if isinstance(node, vy_ast.Name):
Expand Down

0 comments on commit 78bad6c

Please sign in to comment.