-
Notifications
You must be signed in to change notification settings - Fork 12
Value printing refactor (pretty print structs) #8
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
Conversation
4510f13
to
3d1b057
Compare
Blocked on rust-lang/rust#51471 |
src/render/locals.rs
Outdated
Ok(format!("{0}", bits)) | ||
} | ||
TypeVariants::TyInt(_) => { | ||
Ok(format!("{0}", bits as i128)) |
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.
this should not work for i64
and smaller. You need to sign extend first
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.
Fixed
src/render/locals.rs
Outdated
}; | ||
pretty.push_str(&format!("{}: {}, ", adt_field.ident.as_str(), match field_pretty { | ||
Ok(field_pretty) => field_pretty, | ||
Err(_err) => "<span style='color: red;'><err></span>".to_string(), |
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.
when does this case occur? if the memory is malformed?
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.
Yes, or not yet initialized.
c58b6d9
to
84dcc83
Compare
6ded07d
to
f2824ca
Compare
24df9f8
to
ade59db
Compare
Sweet, this makes reading the local table so much better. For larger structs we might want to wrap it in a |
8d0cf9e
to
4864e90
Compare
4864e90
to
f5de0e6
Compare
9127c24
to
cf59695
Compare
TODO
Value