derive Clone for grammars
This commit is contained in:
parent
3beb298a6d
commit
f99f22f477
2 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ pub trait Purrchance {
|
|||
fn eval(&self, g: &Grammar) -> Option<String>;
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Symbol {
|
||||
Terminal(String),
|
||||
NonTerminal(String),
|
||||
|
@ -25,7 +25,7 @@ impl Purrchance for Symbol {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Expr(Vec<Symbol>);
|
||||
|
||||
impl Purrchance for Expr {
|
||||
|
@ -34,7 +34,7 @@ impl Purrchance for Expr {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct List(Vec<(Expr, f64)>);
|
||||
|
||||
impl Purrchance for List {
|
||||
|
@ -43,7 +43,7 @@ impl Purrchance for List {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Grammar(HashMap<String,List>);
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue