summaryrefslogtreecommitdiff
path: root/src/ast/convert.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/convert.rs')
-rw-r--r--src/ast/convert.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ast/convert.rs b/src/ast/convert.rs
index f828a16..7ae3147 100644
--- a/src/ast/convert.rs
+++ b/src/ast/convert.rs
@@ -123,6 +123,7 @@ impl Context {
&mut self,
name: &T,
args: I,
+ convert_mode: ConvertMode,
) -> Option<Term>
where
String: Borrow<T>,
@@ -151,7 +152,7 @@ impl Context {
self.variables.insert(var, value);
}
- let res = Some(term.clone().convert(self));
+ let res = Some(term.clone().convert(self, convert_mode));
for (name, value, indices) in old {
for (index, binding) in indices {
@@ -166,6 +167,12 @@ impl Context {
}
}
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+pub enum ConvertMode {
+ NoSubstitution,
+ WithSubstitution,
+}
+
pub trait Convert: std::fmt::Debug {
- fn convert(&self, context: &mut Context) -> Term;
+ fn convert(&self, context: &mut Context, mode: ConvertMode) -> Term;
}