Skip to content

Commit

Permalink
add a constant folding step after ast rewriting
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Jul 8, 2024
1 parent a44e60e commit af1d013
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions qlasskit/ast2ast/ast2ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ def ast2ast(a_tree):
# Rewrite the ast
a_tree = ASTRewriter().visit(a_tree)

# Fold constants again
a_tree = ConstantFolder().visit(a_tree)

# print(ast.dump(a_tree))
return a_tree

0 comments on commit af1d013

Please sign in to comment.