-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore: update solang-parser #4661
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.
awesome!
love that we could simplify this
lgtm, pending release
Looks like 2 different errors in tests (CI):
cc @rkrasiuk @jpopesculian pls advise |
@rkrasiuk please take a look at the failing tests, this is now a blocker for any PR that needs new ethers release |
@DaniPopes thanks for the update, you are an OG! looking at failing tests rn |
regarding 2, i narrowed it down to the line below Line 2332 in 37d4625
not sure yet under which circumstances the location is invalid, tried changing it to return_source_if_disabled!(self, func.loc().with_end(body.loc().end())); but that results in different errors 🤷♂️ |
I've added a smaller repro
but couldn't make any additional progress because not familiar with the assumptions here, could please take another look at the |
Isn't (1) the intended behaviour? |
yes, was just pointing out the callgraph
yes, but I didn't before, so something changed here |
The old manual implementation of In
Should we revert to the old manual trait with just the special case for |
this sounds reasonable, would give us a bit more flexibility |
Done, this fixes point number 2. Number 1 is fixed with: diff --git a/fmt/testdata/IfStatement/fmt.sol b/fmt/testdata/IfStatement/fmt.sol
index 4c430108..cb2f8874 100644
--- a/fmt/testdata/IfStatement/fmt.sol
+++ b/fmt/testdata/IfStatement/fmt.sol
@@ -104,9 +104,7 @@ contract IfStatement {
execute();
}
- if (condition && ((condition || anotherLongCondition))) {
- execute();
- }
+ if (condition && ((condition || anotherLongCondition))) execute();
// if statement
if (condition) execute();
diff --git a/fmt/testdata/IfStatement2/fmt.sol b/fmt/testdata/IfStatement2/fmt.sol
index f9c27b1f..10ae4360 100644
--- a/fmt/testdata/IfStatement2/fmt.sol
+++ b/fmt/testdata/IfStatement2/fmt.sol
@@ -2,8 +2,6 @@ contract IfStatement {
function test() external {
bool anotherLongCondition;
- if (condition && ((condition || anotherLongCondition))) {
- execute();
- }
+ if (condition && ((condition || anotherLongCondition))) execute();
}
} But I guess the question here is still why did this change. |
/// Casts the current `W` writer as a `String` reference. Should only be used for debugging. | ||
#[allow(dead_code)] | ||
unsafe fn buf_contents(&self) -> &String { | ||
match &self.temp_bufs[..] { | ||
[] => unsafe { *(&self.buf.w as *const W as *const &mut String) }, | ||
[.., buf] => &buf.w, | ||
} | ||
} |
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.
Used inline with trace!("{}", self.buf_contents())
This avoids adding fmt::Debug
bounds everywhere, makes debugging faster. LMK if this should be removed.
fn visit_parser_error(&mut self, loc: Loc) -> Result<()> { | ||
Err(FormatterError::InvalidParsedItem(loc)) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { |
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.
moved to ../tests/it/formatter.rs
fmt/src/solang_ext/loc.rs
Outdated
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.
diff in: 815e1d8
Some failing anvil test unrelated |
merged the anvil issue from master,
still fails though |
yep honestly i don't know why, i think it's fine just keeping the change by patching the tests |
fine with that, can reiterate when we receive feedback, but this pr is now blocking for a while |
This comment was marked as resolved.
This comment was marked as resolved.
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.
lgtm!
Motivation
Relevant changes:
forge-fmt
andforge-doc
(2017824)Waiting on solang-parser v0.2.4 release, draft until then.Blocked by
gakonst/ethers-rs#2334 andan Ethers release.Solution