jacques_a_dit/
ir.rs

1#[derive(Debug)]
2pub struct Value<'a> {
3    pub object: &'a str,
4    pub property: &'a str,
5}
6
7impl<'a> Value<'a> {
8    fn to_string(&self) -> String {
9        let mut out = "".to_string();
10
11        out.push_str(&self.object.to_string());
12        out.push_str(".");
13        out.push_str(&self.property.to_string());
14
15        return out;
16    }
17
18    pub fn is_equal(&self, right: String) -> bool {
19        return self.to_string() == right
20    }
21}
22
23#[derive(Debug)]
24pub struct Rule<'a> {
25    pub left: Value<'a>,
26    pub cmp: &'a str,
27    pub right: &'a str,
28}