Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] Enable the new ast builder by default #3516

Merged
merged 4 commits into from Nov 15, 2021

Conversation

lin-hitonami
Copy link
Collaborator

@lin-hitonami lin-hitonami commented Nov 15, 2021

issue = #3038

When fixing pylint R1705 no-else-return, some of the raise statements are moved outside the else scope of the static-if, resulting raising errors when traversing to the Raise node. For example:

    if ti.static(A.n == 2): 
        ret = svd2d(A, dt)
        return ret
    elif ti.static(A.n == 3):
        return svd3d(A, dt)
    else:
        raise Exception("SVD only supports 2D and 3D matrices.")

was changed to

    if ti.static(A.n == 2):
        ret = svd2d(A, dt)
        return ret
    if ti.static(A.n == 3):
        return svd3d(A, dt)
    raise Exception("SVD only supports 2D and 3D matrices.")

and the AST builder will continue to visit the Raise node because it is not in the else branch of static-if.
Immediate termination of traversing when meeting return statement can be supported in the future.

@netlify
Copy link

netlify bot commented Nov 15, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: 7890e85

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/6192286a96df8b0009d27c94

Copy link
Contributor

@g1n0st g1n0st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@strongoier strongoier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@g1n0st g1n0st merged commit c06243b into taichi-dev:master Nov 15, 2021
@lin-hitonami lin-hitonami deleted the enable_ast_refactor branch January 7, 2022 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants