-
Notifications
You must be signed in to change notification settings - Fork 546
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
Added selector inline macro for starknet. #3912
Conversation
52f5b27
to
a0c56cc
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 18 of 18 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi and @spapinistarkware)
crates/cairo-lang-compiler/src/db.rs
line 103 at r1 (raw file):
pub fn with_inline_macro_plugin( &mut self, name: impl Into<String>,
why not just &str ? Less stuff to monomorphize for Rust compiler
Suggestion:
&str
81a37cc
to
d62fa48
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: 14 of 18 files reviewed, 1 unresolved discussion (waiting on @mkaput and @spapinistarkware)
crates/cairo-lang-compiler/src/db.rs
line 103 at r1 (raw file):
Previously, mkaput (Marek Kaput) wrote…
why not just &str ? Less stuff to monomorphize for Rust compiler
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 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi and @spapinistarkware)
crates/cairo-lang-starknet/src/inline_macros/selector.rs
line 9 at r2 (raw file):
/// Macro for expanding a selector to a string literal. #[derive(Debug)]
May I ask you to add this impl? I am relying on having T: Default
bounds in Scarb code: https://github.com/software-mansion/scarb/blob/bf927194941f6c0ce62677e7e2ef4f9122489ff6/scarb/src/compiler/plugin/builtin.rs#L24
Suggestion:
#[derive(Debug, Default)]
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: all files reviewed, 1 unresolved discussion (waiting on @mkaput and @spapinistarkware)
crates/cairo-lang-starknet/src/inline_macros/selector.rs
line 9 at r2 (raw file):
Previously, mkaput (Marek Kaput) wrote…
May I ask you to add this impl? I am relying on having
T: Default
bounds in Scarb code: https://github.com/software-mansion/scarb/blob/bf927194941f6c0ce62677e7e2ef4f9122489ff6/scarb/src/compiler/plugin/builtin.rs#L24
if at some point we'd have plugins that requires params - how would you support it?
or all params for such plugins would ahve to be salsa db inputs? (as they are for cfg for example)
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: all files reviewed, 1 unresolved discussion (waiting on @orizi and @spapinistarkware)
crates/cairo-lang-starknet/src/inline_macros/selector.rs
line 9 at r2 (raw file):
Previously, orizi wrote…
if at some point we'd have plugins that requires params - how would you support it?
or all params for such plugins would ahve to be salsa db inputs? (as they are for cfg for example)
Pull stuff from salsa. I can't see any other way to pass params to plugins when they'll be written as packages, especially because I believe the constructor will have to be representable as extern "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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mkaput and @spapinistarkware)
crates/cairo-lang-starknet/src/inline_macros/selector.rs
line 9 at r2 (raw file):
Previously, mkaput (Marek Kaput) wrote…
Pull stuff from salsa. I can't see any other way to pass params to plugins when they'll be written as packages, especially because I believe the constructor will have to be representable as
extern "C"
.
Done.
d62fa48
to
dfe2d18
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 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
f7a010a
to
b98ade6
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 8 of 8 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
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 8 of 8 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
b98ade6
to
f3dde63
Compare
f3dde63
to
c610b37
Compare
c610b37
to
498ef50
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 6 of 18 files at r1, 2 of 4 files at r2, 1 of 1 files at r3, 4 of 8 files at r4, 4 of 4 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi and @spapinistarkware)
crates/cairo-lang-starknet/src/inline_macros/selector.rs
line 28 at r5 (raw file):
let diagnostics = vec![PluginDiagnostic { stable_ptr: syntax.stable_ptr().untyped(), message: "selector macro must have a single argument".to_string(),
Suggestion:
Selector
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: all files reviewed, 1 unresolved discussion (waiting on @orizi and @spapinistarkware)
commit-id:5bae488f
498ef50
to
7f21c80
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 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
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 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
Stack:
Hash
. #3936get_impl
. #3934This change is