ProgrammingLanguage types need Debug

This commit is contained in:
greg 2017-01-21 14:34:17 -08:00
parent 1ac440c8df
commit 5e474231da

View File

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