-
Notifications
You must be signed in to change notification settings - Fork 595
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
Add array! macro. #3501
Add array! macro. #3501
Conversation
There was a problem hiding this 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 and @spapinistarkware)
a discussion (no related file):
Change target branch.
There was a problem hiding this 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 and @spapinistarkware)
crates/cairo-lang-plugins/src/test_data/inline_macros
line 206 at r1 (raw file):
_temp_array.append(2); _temp_array.append(3);
Trying to remove these whitespaces.
There was a problem hiding this 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, 2 unresolved discussions (waiting on @gilbens-starkware and @spapinistarkware)
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 17 at r1 (raw file):
let mut expanded_code = "{ let mut _temp_array = ArrayTrait::new();
make this name worse.
?
Suggestion:
__array_builder_macro_result___
8aa8821
to
128d1ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 3 of 4 files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @orizi)
a discussion (no related file):
Do we want square brackets? array![a,b,c]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @orizi)
748a0f4
to
53dad6d
Compare
128d1ce
to
060e725
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 4 files reviewed, 3 unresolved discussions (waiting on @orizi and @spapinistarkware)
a discussion (no related file):
Previously, spapinistarkware (Shahar Papini) wrote…
Do we want square brackets?
array![a,b,c]
?
Yes, I am adding it.
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 17 at r1 (raw file):
Previously, orizi wrote…
make this name worse.
?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r3.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @spapinistarkware)
53dad6d
to
36074f7
Compare
060e725
to
1c184cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @spapinistarkware)
a discussion (no related file):
Previously, gilbens-starkware (Gil Ben-Shachar) wrote…
Yes, I am adding it.
adding a block for this :)
36074f7
to
08f4b8d
Compare
1c184cc
to
745ecb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 4 files reviewed, 2 unresolved discussions (waiting on @orizi and @spapinistarkware)
a discussion (no related file):
Previously, orizi wrote…
adding a block for this :)
Done.
08f4b8d
to
46ee498
Compare
745ecb3
to
823487b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r5, all commit messages.
Reviewable status: 2 of 4 files reviewed, 5 unresolved discussions (waiting on @gilbens-starkware and @spapinistarkware)
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 24 at r6 (raw file):
arg.as_syntax_node().get_text(db) )); }
Suggestion:
let mut expanded_code = "{
let mut __array_builder_macro_result__ = ArrayTrait::new();"
.to_string();
for arg in args {
expanded_code.push_str(&format!(
"\n __array_builder_macro_result__.append({});",
arg.as_syntax_node().get_text(db)
));
}
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 29 at r6 (raw file):
__array_builder_macro_result__ }", );
Suggestion:
expanded_code.push_str(
"\n __array_builder_macro_result__
}",
);
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 34 at r6 (raw file):
} fn is_bracket_type_allowed(
doc
Code quote:
is_bracket_type_allowed(
46ee498
to
de9b26d
Compare
e1eb7b9
to
68d990e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 26 files reviewed, 5 unresolved discussions (waiting on @orizi and @spapinistarkware)
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 24 at r6 (raw file):
arg.as_syntax_node().get_text(db) )); }
Done.
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 29 at r6 (raw file):
__array_builder_macro_result__ }", );
Done.
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 34 at r6 (raw file):
Previously, orizi wrote…
doc
It is docd in the trait.
68d990e
to
9362fc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 23 files at r7, 23 of 23 files at r8, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @spapinistarkware)
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 19 at r8 (raw file):
for arg in args { expanded_code.push_str(&format!( "\n __array_builder_macro_result__.append({});",
Suggestion:
expanded_code.push_str(&format!(
"\n __array_builder_macro_result__.append({});",
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 25 at r8 (raw file):
expanded_code.push_str( "\n __array_builder_macro_result__ }",
Suggestion:
expanded_code.push_str(
"\n __array_builder_macro_result__
}",
9362fc1
to
4f76824
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 25 of 26 files reviewed, 3 unresolved discussions (waiting on @orizi and @spapinistarkware)
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 19 at r8 (raw file):
for arg in args { expanded_code.push_str(&format!( "\n __array_builder_macro_result__.append({});",
Done.
crates/cairo-lang-plugins/src/plugins/inline_macros/array.rs
line 25 at r8 (raw file):
expanded_code.push_str( "\n __array_builder_macro_result__ }",
Done.
4f76824
to
8dfa48a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r9, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @spapinistarkware)
264f95e
to
c21438d
Compare
8dfa48a
to
c3a07a4
Compare
c21438d
to
8e4d068
Compare
c3a07a4
to
d29110c
Compare
Resolves #3220. |
This change is