2014-12-22 23:20:31 -06:00
|
|
|
pub struct Lexer<'a> {
|
|
|
|
input: &'a str,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Lexer<'a> {
|
|
|
|
pub fn new(input: &'a str) -> Lexer<'a> {
|
|
|
|
Lexer { input: input }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Parser<'a> {
|
|
|
|
lexer: &'a mut Lexer<'a>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Parser<'a> {
|
|
|
|
pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
|
|
|
|
Parser { lexer: lexer }
|
2018-12-25 09:56:47 -06:00
|
|
|
//~^ ERROR explicit lifetime required in the type of `lexer` [E0621]
|
2014-12-22 23:20:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|