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

Avoid panics in print! and format! macros when missing parens #5470

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

mkaput
Copy link
Contributor

@mkaput mkaput commented Apr 24, 2024

This change is Reviewable

Copy link
Contributor Author

@mkaput mkaput 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 2 files reviewed, all discussions resolved (waiting on @orizi)


crates/cairo-lang-semantic/src/expr/test_data/inline_macros line 640 at r1 (raw file):


    // Missing parens.
    print!;

FYI This was panicking the compiler to date.

Base automatically changed from spr/main/3912684a to main April 24, 2024 13:12
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 2 files reviewed, 1 unresolved discussion (waiting on @mkaput)


crates/cairo-lang-semantic/src/inline_macros/print.rs line 77 at r1 (raw file):

                "args".to_string(),
                arguments.arg_list(db).map_or_else(RewriteNode::empty, |n| {
                    RewriteNode::new_trimmed(n.as_syntax_node())

do the same for format.

@mkaput mkaput changed the title Avoid panics in print! macro family when missing parens Avoid panics in print! and format! macros when missing parens Apr 24, 2024
Copy link
Contributor Author

@mkaput mkaput 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 3 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-semantic/src/inline_macros/print.rs line 77 at r1 (raw file):

Previously, orizi wrote…

do the same for format.

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 1 of 2 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @mkaput)

@mkaput mkaput added this pull request to the merge queue Apr 24, 2024
Merged via the queue into main with commit d37d3c1 Apr 24, 2024
43 checks passed
@mkaput mkaput deleted the spr/main/d79a9241 branch April 24, 2024 14:10
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.

2 participants