Skip to content

DRY implementation of group_match_arms and surrounding utilities #7747

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

Merged
merged 1 commit into from
May 18, 2025

Conversation

eytan-starkware
Copy link
Contributor

@eytan-starkware eytan-starkware commented May 12, 2025

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions


crates/cairo-lang-lowering/src/lower/lower_match.rs line 1037 at r1 (raw file):

        arms: vec![],
        location,
    });

seems like it should move into the new function.

Code quote:

    let empty_match_info = MatchInfo::Enum(MatchEnumInfo {
        concrete_enum_id,
        input: match_input,
        arms: vec![],
        location,
    });

crates/cairo-lang-lowering/src/lower/lower_match.rs line 1410 at r1 (raw file):

    }

    fn collect_match_arms(self, concrete_variants: &[ConcreteVariant]) -> Vec<MatchArm> {

doc.


crates/cairo-lang-lowering/src/lower/lower_match.rs line 1517 at r1 (raw file):

        .collect();

    fn lower_arm_expr(

doc

@eytan-starkware eytan-starkware force-pushed the spr/main/5d520ca7 branch 2 times, most recently from fb4cd21 to a61be96 Compare May 13, 2025 10:50
Copy link
Contributor Author

@eytan-starkware eytan-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/lower/lower_match.rs line 1037 at r1 (raw file):

Previously, orizi wrote…

seems like it should move into the new function.

This is different between Extern and Concrete so I left it outside. Maybe a bit further on I will remove this duplication (the extern/concrete difference also affects the final match_info for finishing the lowering of the match)


crates/cairo-lang-lowering/src/lower/lower_match.rs line 1410 at r1 (raw file):

Previously, orizi wrote…

doc.

Done.


crates/cairo-lang-lowering/src/lower/lower_match.rs line 1517 at r1 (raw file):

Previously, orizi wrote…

doc

Done.

Base automatically changed from spr/main/74bf1dfc to main May 13, 2025 11:17
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @eytan-starkware)


crates/cairo-lang-lowering/src/lower/lower_match.rs line 329 at r3 (raw file):

/// Builds a variant match tree from the arms of a match statement.
/// The tree is used to check for unreachable patterns and represent for each variant it's .

Suggestion:

/// The tree is used to check for unreachable patterns and represent for each variant it's ????.

Copy link
Contributor Author

@eytan-starkware eytan-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/lower/lower_match.rs line 329 at r3 (raw file):

/// Builds a variant match tree from the arms of a match statement.
/// The tree is used to check for unreachable patterns and represent for each variant it's .

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @eytan-starkware)

@eytan-starkware eytan-starkware added this pull request to the merge queue May 18, 2025
Merged via the queue into main with commit 897406d May 18, 2025
49 checks passed
@eytan-starkware eytan-starkware deleted the spr/main/5d520ca7 branch May 18, 2025 17:38
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.

3 participants