mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Consolidate variable pretty printing
This commit is contained in:
parent
3de35f7aa2
commit
a9507cf917
7 changed files with 28 additions and 43 deletions
|
@ -336,7 +336,7 @@ struct Context<'a> {
|
|||
recursion_structs_to_expand: Vec<Variable>,
|
||||
}
|
||||
|
||||
pub fn content_to_string(
|
||||
fn content_to_string(
|
||||
content: &Content,
|
||||
subs: &Subs,
|
||||
home: ModuleId,
|
||||
|
@ -364,6 +364,17 @@ pub fn content_to_string(
|
|||
buf
|
||||
}
|
||||
|
||||
pub fn name_and_print_var(
|
||||
var: Variable,
|
||||
subs: &mut Subs,
|
||||
home: ModuleId,
|
||||
interns: &Interns,
|
||||
) -> String {
|
||||
let named_result = name_all_type_vars(var, subs);
|
||||
let content = subs.get_content_without_compacting(var);
|
||||
content_to_string(content, subs, home, interns, named_result)
|
||||
}
|
||||
|
||||
pub fn get_single_arg<'a>(subs: &'a Subs, args: &'a AliasVariables) -> &'a Content {
|
||||
debug_assert_eq!(args.len(), 1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue