SMAT-Lab / Scalpel

Scalpel: The Python Static Analysis Framework
Apache License 2.0
279 stars 42 forks source link

rewriter.random_var_renaming() #13

Closed Simba2017 closed 2 years ago

Simba2017 commented 2 years ago
src="""
def func(x,y):
    z = 0.
    for i in range(x+y):
        z+=i
    return z
"""
output = """
def func(x, y):
    z = 0.0
    for i in _renamed_one(x + y):
        z += i
    return z
"""

range is changed to _renamed_one

Jarvx commented 2 years ago

A new feature has been added to skip call names as rename target identifiers.