use super::region::Region;
#[cfg(feature = "serde")]
use serde::{Serialize, Deserialize};
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Rules {
pub symbols: Vec<char>,
pub region_tree: Region,
pub escape_symbol: char,
pub compounds: Vec<(char, char)>
}
impl Rules {
pub fn new(symbols: Vec<char>, compounds: Vec<(char, char)>, region_tree: Region) -> Rules {
Rules {
symbols,
compounds,
region_tree,
escape_symbol: '\\'
}
}
pub fn set_escape(mut self, symbol: char) -> Self {
self.escape_symbol = symbol;
self
}
}