Skip to content

Commit

Permalink
Add dump_bytecodes parameter to method_to_bytecode
Browse files Browse the repository at this point in the history
This documents how to use the dump() methods, and makes it just a True parameter away, too.
  • Loading branch information
smarr committed Sep 29, 2023
1 parent 481ec72 commit 8525d39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_bytecode_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ def bgenc(cgenc, mgenc):
return bgenc


def method_to_bytecodes(mgenc, source):
def method_to_bytecodes(mgenc, source, dump_bytecodes=False):
parser = Parser(StringStream(source.strip()), "test", current_universe)
parser.method(mgenc)
if dump_bytecodes:
dump(mgenc)
return mgenc.get_bytecodes()


Expand Down

0 comments on commit 8525d39

Please sign in to comment.