Ast: add getters for variables
All checks were successful
ci/woodpecker/push/build_rust Pipeline was successful

This commit is contained in:
Akemi Izuko 2023-11-17 14:20:09 -07:00
parent 59be92491f
commit a875a78f4b
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC

View file

@ -75,10 +75,20 @@ impl GazType for Literal {
#[builder(setter(into))] #[builder(setter(into))]
pub struct Variable { pub struct Variable {
type_: BaseType, type_: BaseType,
quantifer: Quantifier, quantifier: Quantifier,
name: String, name: String,
} }
impl Variable {
pub fn get_name(&self) -> String {
self.name.clone()
}
pub fn get_quantifier(&self) -> Quantifier {
self.quantifier
}
}
impl ToString for Variable { impl ToString for Variable {
fn to_string(&self) -> String { fn to_string(&self) -> String {
self.name.clone() self.name.clone()