-
Notifications
You must be signed in to change notification settings - Fork 583
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
Basic macro support. #7238
base: high-level-inline-macros
Are you sure you want to change the base?
Basic macro support. #7238
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 8 of 17 files at r1, all commit messages.
Reviewable status: 8 of 17 files reviewed, 6 unresolved discussions (waiting on @mkaput)
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 24 at r1 (raw file):
resolver_data: Arc<ResolverData>, rules: Vec<MacroRuleData>, }
doc and:
Suggestion:
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MacroDeclarationData {
rules: Vec<MacroRuleData>,
attributes: Vec<Attribute>,
diagnostics: Diagnostics<SemanticDiagnostic>,
resolver_data: Arc<ResolverData>,
}
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 33 at r1 (raw file):
#[derive(Debug, Clone, PartialEq, Eq)] enum PlaceholderKind {
doc
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 48 at r1 (raw file):
} pub fn priv_macro_declaration_data(
[pointback] doc.
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 175 at r1 (raw file):
} pub fn expand_macro_rule_ex(
doc
corelib/src/test/language_features/macro_test.cairo
line 14 at r1 (raw file):
}; }
can you add a non - comma seperator or lack of seperators as another test examples?
crates/cairo-lang-semantic/src/expr/compute.rs
line 455 at r1 (raw file):
(true, true) => { return Err(ctx.diagnostics.report(syntax, AmbiguousInlineMacro(macro_name.into()))); }
probably user-defined should just win against external definition.
external is basically "prelude".
probably should have extern
for them in the end or something of that manner.
Code quote:
match (inline_macro_plugin_found, is_user_defined_macro_found) {
(true, true) => {
return Err(ctx.diagnostics.report(syntax, AmbiguousInlineMacro(macro_name.into())));
}
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 17 of 17 files at r1, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @gilbens-starkware)
b7fa0c4
to
023c9fe
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: 12 of 19 files reviewed, 6 unresolved discussions (waiting on @mkaput and @orizi)
corelib/src/test/language_features/macro_test.cairo
line 14 at r1 (raw file):
Previously, orizi wrote…
can you add a non - comma seperator or lack of seperators as another test examples?
Done.
crates/cairo-lang-semantic/src/expr/compute.rs
line 455 at r1 (raw file):
Previously, orizi wrote…
probably user-defined should just win against external definition.
external is basically "prelude".probably should have
extern
for them in the end or something of that manner.
Done.
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 24 at r1 (raw file):
Previously, orizi wrote…
doc and:
Done.
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 33 at r1 (raw file):
Previously, orizi wrote…
doc
Done.
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 48 at r1 (raw file):
Previously, orizi wrote…
[pointback] doc.
Done.
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 175 at r1 (raw file):
Previously, orizi wrote…
doc
Done.
023c9fe
to
f09f529
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 5 of 7 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware)
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 24 at r1 (raw file):
Previously, gilbens-starkware (Gil Ben-Shachar) wrote…
Done.
doc.
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 175 at r1 (raw file):
Previously, gilbens-starkware (Gil Ben-Shachar) wrote…
Done.
but what does it do?
crates/cairo-lang-semantic/src/items/macro_declaration.rs
line 27 at r3 (raw file):
#[derive(Debug, Clone, PartialEq, Eq)] pub struct MacroRuleData {
doc
No description provided.