Skip to content

Commit

Permalink
silence
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Jan 4, 2024
1 parent 7441734 commit f987d2f
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/compiler/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ fn namespace_helper(
}
HelperForm::Deftype(ty) => {
let new_helpers = generate_type_helpers(&ty.parsed);
eprintln!("namespacing deftype {}", value.to_sexp());
let mut result_helpers = Vec::new();
for h in new_helpers.into_iter() {
let new_helper_name = if let Some(p) = name.parent() {
Expand Down Expand Up @@ -159,14 +158,12 @@ pub fn find_helper_target<'a>(
// Get a list namespace refs from the namespace identified by parent_ns.
let tour_helpers: Vec<FoundHelper> = tour_helpers(&helpers).collect();
let home_ns: Vec<&FoundHelper> = tour_helpers.iter().filter(|found| {
eprintln!("find tour: got ns {} containing {}", display_namespace(found.namespace.clone()), found.helper.to_sexp());
found.namespace == parent_ns
}).collect();

// check the matching namespace to the one specified to see if we can find the
// target.
for h in home_ns.iter() {
eprintln!("finding {} checking {}", display_namespace(Some(name)), h.helper.to_sexp());
if let HelperForm::Deftype(dt) = &h.helper {
let new_helpers = generate_type_helpers(&dt.parsed);
for gh in new_helpers.iter() {
Expand Down Expand Up @@ -204,7 +201,6 @@ pub fn find_helper_target<'a>(
None
}
}) {
eprintln!("try to find {} ({}) using import {} in namespace {}", decode_string(orig_name), decode_string(&name.as_u8_vec(LongNameTranslation::Namespace)), HelperForm::Defnsref(ns_spec.clone()).to_sexp(), display_namespace(parent_ns.clone()));
match &ns_spec.specification {
ModuleImportSpec::Qualified(q) => {
if let Some(t) = &q.target {
Expand Down Expand Up @@ -258,7 +254,6 @@ pub fn find_helper_target<'a>(
}
}
ModuleImportSpec::Hiding(_, h) => {
eprintln!("check namespace {} for {}", decode_string(&ns_spec.longname.as_u8_vec(LongNameTranslation::Namespace)), decode_string(&orig_name));
if parent.is_some() {
continue;
}
Expand Down Expand Up @@ -384,7 +379,6 @@ fn resolve_namespaces_in_expr(
}
}

eprintln!("find_helper_target {} in parent_ns {}", decode_string(&name), display_namespace(parent_ns.clone()));
let (target_full_name, target_helper) =
if let Some((target_full_name, target_helper)) = find_helper_target(
opts.clone(),
Expand All @@ -397,7 +391,6 @@ fn resolve_namespaces_in_expr(
} else if is_compiler_builtin(&name) {
return Ok(expr.clone());
} else {
eprintln!("trying to find {}, but failed", decode_string(&name));
return Err(CompileErr(expr.loc(), format!("could not find helper {} in {}", decode_string(&name), display_namespace(parent_ns.clone()))));
};

Expand Down Expand Up @@ -542,7 +535,6 @@ fn resolve_namespaces_in_helper(
) -> Result<HelperFormResult, CompileErr> {
match helper {
HelperForm::Defnamespace(ns) => {
eprintln!("have namespace {}", helper.to_sexp());
let combined_ns =
if let Some(p) = parent_ns {
p.combine(&ns.longname)
Expand Down Expand Up @@ -605,9 +597,7 @@ fn resolve_namespaces_in_helper(
HelperForm::Deftype(dt) => {
let mut new_helpers = generate_type_helpers(&dt.parsed);
let mut result_helpers = Vec::new();
eprintln!("processing deftype {}", helper.to_sexp());
for h in new_helpers.iter_mut() {
eprintln!("resolving generated {}", h.to_sexp());
let results = resolve_namespaces_in_helper(
resolved_helpers,
opts.clone(),
Expand All @@ -632,8 +622,6 @@ pub fn resolve_namespaces(
let mut resolved_helpers: BTreeMap<ImportLongName, HelperFormResult> = BTreeMap::new();
let mut new_resolved_helpers: BTreeMap<ImportLongName, HelperFormResult> = BTreeMap::new();

eprintln!("resolve_namespaces: program = {}", program.to_sexp());

// The main expression is in the scope of the program arguments.
let mut program_scope = HashSet::new();
capture_scope(&mut program_scope, program.args.clone());
Expand All @@ -660,7 +648,6 @@ pub fn resolve_namespaces(
let (parent, _) = name.parent_and_name();

for helper in helpers.new_helpers.iter() {
eprintln!("{} doing tree build via {}", display_namespace(parent.as_ref()), helper.to_sexp());
let mut result_helpers = Vec::new();
let mut renamed_helpers = namespace_helper(&name, &helper);

Expand All @@ -680,7 +667,6 @@ pub fn resolve_namespaces(
continue;
}

eprintln!("resolving {}", h.to_sexp());
let results = resolve_namespaces_in_helper(
&mut round_resolved_helpers,
opts.clone(),
Expand All @@ -689,12 +675,6 @@ pub fn resolve_namespaces(
h
)?;

for h in results.new_helpers.iter() {
eprintln!("=> {}", h.to_sexp());
}

eprintln!("just resolved {}", decode_string(&full_name.as_u8_vec(LongNameTranslation::Namespace)));

result_helpers.extend(results.new_helpers.clone());
resolved_helpers.insert(full_name, HelperFormResult::new(&[], None));
}
Expand All @@ -709,9 +689,6 @@ pub fn resolve_namespaces(
// The set of helpers is the set of helpers in resolved_helpers al
let mut all_helpers = Vec::new();
for v in resolved_helpers.into_values() {
for h in v.new_helpers.iter() {
eprintln!("resolved helper: {}", h.to_sexp());
}
all_helpers.extend(v.new_helpers);
}
Ok(CompileForm {
Expand Down

0 comments on commit f987d2f

Please sign in to comment.