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

[TVMScript] Use new variable frame in If/Then/Else #14250

Merged
merged 2 commits into from
Mar 23, 2023

Conversation

Lunderberg
Copy link
Contributor

Previously, while TVMScript introduces a new scope for other contexts (e.g. for, while, with, etc), the if and else blocks did not introduce a new scope. This caused erroneous parsing errors if the if and else blocks each contained a variable with the same name. Added a self.var_table.with_frame() context resolves this issue.

Previously, while TVMScript introduces a new scope for other
contexts (e.g. `for`, `while`, `with`, etc), the `if` and `else`
blocks did not introduce a new scope.  This caused erroneous parsing
errors if the `if` and `else` blocks each contained a variable with
the same name.  Added a `self.var_table.with_frame()` context resolves
this issue.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 9, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@Hzfengsy
Copy link
Member

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

Looks like a nice enhancement! LGTM. @wrongtest-intellif could you take a look?

@junrushao
Copy link
Member

I do believe this is good to merge. @wrongtest-intellif what do you think?

@Lunderberg
Copy link
Contributor Author

Thank you, @junrushao!

Merged main into the PR branch to resolve conflicts, so it'll be ready for merge.

@junrushao junrushao merged commit 3f56a95 into apache:main Mar 23, 2023
@junrushao
Copy link
Member

Thanks @Lunderberg!!

@Lunderberg Lunderberg deleted the tvmscript_if_then_else_varframe branch March 23, 2023 21:12
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.

4 participants