Skip to content

Commit

Permalink
Support function renaming with "_" prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
hanno-becker committed Mar 20, 2024
1 parent ecf9179 commit 1d053f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions slothy/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ def change_funcname(line):
s = re.sub( f"{old_funcname}:", f"{new_funcname}:", s)
s = re.sub( f"\\.global(\\s+){old_funcname}", f".global\\1{new_funcname}", s)
s = re.sub( f"\\.type(\\s+){old_funcname}", f".type\\1{new_funcname}", s)
# On Mac, function names often start with an underscore
s = re.sub( f"\\.global(\\s+)_{old_funcname}", f".global\\1_{new_funcname}", s)
s = re.sub( f"\\.type(\\s+)_{old_funcname}", f".type\\1_{new_funcname}", s)
return line.copy().set_text(s)
return [ change_funcname(s) for s in source ]

Expand Down

0 comments on commit 1d053f2

Please sign in to comment.