Macro stuff#4687
Open
coolreader18 wants to merge 4 commits into
Open
Conversation
374297d to
77b8f63
Compare
Member
|
@coolreader18 I like this patch so much even without parallel parts. Could you split this PR to 2 chunks one for refactoring and the other one for parallel compilation? |
youknowone
reviewed
Mar 15, 2023
| let path = input.call(syn::Path::parse_mod_style)?; | ||
| let eq_token: Token![=] = input.parse()?; | ||
| let span = input.span(); | ||
| fn parse_litstr(input: ParseStream) -> ParseResult<LitStr> { |
Member
There was a problem hiding this comment.
Suggested change
| fn parse_litstr(input: ParseStream) -> ParseResult<LitStr> { | |
| fn parse_lit_str(input: ParseStream) -> ParseResult<LitStr> { |
| } | ||
| } | ||
|
|
||
| impl Parse for PyCompileArgs { |
Member
There was a problem hiding this comment.
what's the motivation to this change?
| fn cmp(&self, other: &Self) -> std::cmp::Ordering { | ||
| Ord::cmp(&self.name, &other.name).then_with(|| { | ||
| cmp_iters(self.cfgs.iter(), other.cfgs.iter(), |a, b| { | ||
| crate::util::cmp_tokenstream(a.to_token_stream(), b.to_token_stream()) |
Member
There was a problem hiding this comment.
Suggested change
| crate::util::cmp_tokenstream(a.to_token_stream(), b.to_token_stream()) | |
| cmp_tokenstream(a.to_token_stream(), b.to_token_stream()) |
Member
There was a problem hiding this comment.
can't we get string from tokenstream and compare them? this is looking a bit too much.
Comment on lines
+132
to
+133
| } else { | ||
| return Err(e); |
Member
There was a problem hiding this comment.
Suggested change
| } else { | |
| return Err(e); |
Member
Author
|
Ough now I wanna use |
Member
|
now we use syn2. will this patch be revived? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is sorta a work in progress that's ready for review, mainly since I'm still not sure whether parallelizing
py_freeze!is actually a good idea. My original idea was to just outputpy_compile!invocations fromfreezeand let rustc parallelize it for us, but it turns out it doesn't actually run proc macros in parallel, so.