ProgrammingLanguage types need Debug
This commit is contained in:
parent
1ac440c8df
commit
5e474231da
@ -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>;
|
||||||
|
Loading…
Reference in New Issue
Block a user