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

[IR] Fix dangling meta_if matching #268

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

chhzh123
Copy link
Member

Description

This PR fixes the dangling meta_if matching issue. Previously, each meta_if needs to be accompanied with a meta_else. Otherwise, different levels of meta_if/else will mix together causing problems.

Examples

For example, in the following case, according to the Python convention, the second meta_else should match the first meta_if based on indention.

with allo.meta_if(...):
    with allo.meta_if(...):
        ...
with allo.meta_else():
    ...

Checklist

  • PR's title starts with a category (e.g. [Bugfix], [IR], [Builder], etc)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage (It would be better to provide ~2 different test cases to test the robustness of your code)
  • Code is well-documented

@chhzh123 chhzh123 merged commit 9c7de52 into cornell-zhang:main Nov 26, 2024
1 check passed
@chhzh123 chhzh123 deleted the fix_metaelse branch November 26, 2024 19:30
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.

1 participant