ProgrammingLanguage types need Debug

This commit is contained in:
greg 2017-01-21 14:34:17 -08:00
parent 1ac440c8df
commit 5e474231da
1 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
use std::fmt::Debug;
pub struct TokenError {
pub msg: String,
@ -8,8 +9,8 @@ pub struct ParseError {
}
pub trait ProgrammingLanguage {
type Token;
type AST;
type Token: Debug;
type AST: Debug;
fn tokenize(input: &str) -> Result<Vec<Self::Token>, TokenError>;
fn parse(input: Vec<Self::Token>) -> Result<Self::AST, ParseError>;