tamer: asg::graph::Asg: Non-exhaustive Debug impl
This hides information that's taking up a lot of space in the parser traces and is not useful information. In particular, the `index` contains a lot of empty space due to pre-interned symbols. The index was going to be converted into a HashMap, but that was reverted because the tradeoff did not make sense, and so this problem remains; see the previous commit for more information. DEV-13159main
parent
d066bb370f
commit
e6abd996b7
|
@ -80,7 +80,6 @@ type Ix = global::ProgSymSize;
|
|||
///
|
||||
/// For more information,
|
||||
/// see the [module-level documentation][self].
|
||||
#[derive(Debug)]
|
||||
pub struct Asg {
|
||||
// TODO: private; see `ld::xmle::lower`.
|
||||
/// Directed graph on which objects are stored.
|
||||
|
@ -102,6 +101,24 @@ pub struct Asg {
|
|||
root_node: NodeIndex<Ix>,
|
||||
}
|
||||
|
||||
impl Debug for Asg {
|
||||
/// Trimmed-down Asg [`Debug`] output.
|
||||
///
|
||||
/// This primarily hides the large `self.index` that takes up so much
|
||||
/// space in parser traces,
|
||||
/// but also hides irrelevant information.
|
||||
///
|
||||
/// The better option in the future may be to create a newtype for
|
||||
/// `index` if it sticks around in its current form,
|
||||
/// which in turn can encapsulate `self.empty_node`.
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
f.debug_struct("Asg")
|
||||
.field("root_node", &self.root_node)
|
||||
.field("graph", &self.graph)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Asg {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
|
|
Loading…
Reference in New Issue