mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Print variables if asked to
This commit is contained in:
parent
bdba56ce74
commit
d13e221678
3 changed files with 11 additions and 0 deletions
|
@ -62,6 +62,7 @@ pub struct DebugPrint {
|
|||
pub print_ranks: bool,
|
||||
pub ignore_polarity: bool,
|
||||
pub print_weakened_vars: bool,
|
||||
pub print_variables: bool,
|
||||
}
|
||||
|
||||
impl DebugPrint {
|
||||
|
@ -71,6 +72,7 @@ impl DebugPrint {
|
|||
print_ranks: false,
|
||||
ignore_polarity: false,
|
||||
print_weakened_vars: false,
|
||||
print_variables: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -658,6 +660,12 @@ fn write_content<'a>(
|
|||
if env.debug.print_ranks {
|
||||
buf.push_str(&format!("⟨@{:?}⟩", subs.get_rank(var).into_usize()));
|
||||
}
|
||||
if env.debug.print_variables {
|
||||
buf.push_str(&format!(
|
||||
"<{:?}>",
|
||||
subs.get_root_key_without_compacting(var)
|
||||
));
|
||||
}
|
||||
|
||||
match subs.get_content_without_compacting(var) {
|
||||
FlexVar(Some(name_index)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue