Commit 4468cbfa authored by Jeff Smits's avatar Jeff Smits

Revert "Doubling down on the constructor caching"

This reverts commit 74575c6c.
parent 74575c6c
This diff is collapsed.
......@@ -158,7 +158,8 @@ impl<'d, 'f : 'd> Eval<'d, 'f> for preprocess::Strategy {
let strategy_name = context.get_term(term_name)?;
let strategy_name = get_string(&*b(&strategy_name)).ok_or_else(|| {
Error::UndefinedStrategy(format!(
"Invocation target is invalid (cannot be evaluated): {}",
"Invocation target is invalid \
(cannot be evaluated): {}",
strategy_name
))
})?;
......
......@@ -295,7 +295,6 @@ impl TryFrom<ctree::PreTerm> for BuildTerm {
}
impl BuildTerm {
#[inline]
pub fn build<'d, 'f : 'd>(&self, context: &MutContext<'d, 'f>) -> Result<ATermRef> {
self.build_with_annos(context, None)
}
......@@ -350,10 +349,9 @@ impl BuildTerm {
} else if s == "Nil" && t.is_empty() {
Ok(context.factory.list(iter::empty()))
} else {
let cons = context.factory.get_known_cons(s).unwrap_or_else(|| s.clone().into());
Ok(context.factory.with_annos(
context.factory.t_application(
&cons,
&s.clone().into(),
t.into_iter(),
),
annos.unwrap_or_default(),
......@@ -368,13 +366,12 @@ impl BuildTerm {
))?;
if let Some(s) = get_string(&*cons) {
let cons = context.factory.get_known_cons(&s).unwrap_or_else(|| s.clone().into());
let string = context.factory.application(&cons, ::std::iter::empty());
let string = context.factory.application(&s.clone().into(), ::std::iter::empty());
if get_string(&*string).is_some() {
Ok(string)
} else {
let application =
context.factory.t_application(&cons, children.iter().cloned());
context.factory.t_application(&s.into(), children.iter().cloned());
Ok(context.factory.with_annos(
application,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment