-
Notifications
You must be signed in to change notification settings - Fork 585
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 allow_attr
attribute for allowing additional attributes
#7253
base: main
Are you sure you want to change the base?
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.
Reviewed 1 of 6 files at r1, 1 of 1 files at r4, all commit messages.
Reviewable status: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @maciektr)
crates/cairo-lang-defs/src/test.rs
line 488 at r4 (raw file):
} cairo_lang_test_utils::test_file_test!(
Why can't this be with any other test group?
Can you please clarify what you mean? Which test group do you think it should be in? |
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.
comment only on https://reviewable.io/reviews/starkware-libs/cairo/7253#-.
Reviewable status: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @DelevoXDG and @maciektr)
crates/cairo-lang-defs/src/test.rs
line 488 at r4 (raw file):
Previously, orizi wrote…
Why can't this be with any other test group?
this seems to prevent a semantic diagnostic - so maybe just add it as part of the semanitc tests.
(despite the fact it is handled in defs db)
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 7 files reviewed, 1 unresolved discussion (waiting on @maciektr and @orizi)
crates/cairo-lang-defs/src/test.rs
line 488 at r4 (raw file):
Previously, orizi wrote…
this seems to prevent a semantic diagnostic - so maybe just add it as part of the semanitc tests.
(despite the fact it is handled in defs db)
Done.
fd7ea79
to
e27dcc8
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 6 files at r1, 5 of 6 files at r5, all commit messages.
Reviewable status: 6 of 7 files reviewed, 2 unresolved discussions (waiting on @maciektr)
crates/cairo-lang-defs/src/db.rs
line 736 at r5 (raw file):
) -> OrderedHashSet<String> { let mut empty_args_diagnostics = Vec::new(); let mut identifier_diadnostics = Vec::new();
do a for with continues instead of creating intermediary vectors.
Code quote:
) -> OrderedHashSet<String> {
let mut empty_args_diagnostics = Vec::new();
let mut identifier_diadnostics = Vec::new();
crates/cairo-lang-defs/src/db.rs
line 779 at r5 (raw file):
plugin_diagnostics.extend(identifier_diadnostics); base_allowed_attributes.union(&additional_attributes).cloned().collect()
this cloning of the set seems like it could get quite costly in some cases.
maybe just return another set and check both?
Code quote:
base_allowed_attributes.union(&additional_attributes).cloned().collect()
Adds
allow_attr
attribute that allows specifying certain attributes that are available only in given scope. This may be useful for marking certain elements of larger entity, e.g. marking enum variant as default: