From 6163c5b259a3e19910c0dfe609fd2cd5540d767a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sun, 2 Feb 2020 17:44:49 +0100 Subject: [PATCH] Use std::rc::Rc types for variable declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These fields may have to be shared in other data structures, such as a variable declaration stack. In order to accomplish that, it’s necessary to wrap the variable declarations in std::rc::Rc. --- src/ast.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 3cb94e0..2514108 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -258,13 +258,13 @@ impl Compare pub struct Exists { - pub parameters: VariableDeclarations, + pub parameters: std::rc::Rc, pub argument: Box, } impl Exists { - pub fn new(parameters: VariableDeclarations, argument: Box) -> Self + pub fn new(parameters: std::rc::Rc, argument: Box) -> Self { Self { @@ -276,13 +276,13 @@ impl Exists pub struct ForAll { - pub parameters: VariableDeclarations, + pub parameters: std::rc::Rc, pub argument: Box, } impl ForAll { - pub fn new(parameters: VariableDeclarations, argument: Box) -> Self + pub fn new(parameters: std::rc::Rc, argument: Box) -> Self { Self { @@ -504,7 +504,7 @@ impl Formula Self::Compare(Compare::new(operator, left, right)) } - pub fn exists(parameters: VariableDeclarations, argument: Box) -> Self + pub fn exists(parameters: std::rc::Rc, argument: Box) -> Self { Self::Exists(Exists::new(parameters, argument)) } @@ -519,7 +519,7 @@ impl Formula Self::boolean(false) } - pub fn for_all(parameters: VariableDeclarations, argument: Box) -> Self + pub fn for_all(parameters: std::rc::Rc, argument: Box) -> Self { Self::ForAll(ForAll::new(parameters, argument)) }