mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
22 lines
412 B
Rust
22 lines
412 B
Rust
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 }
|
|
//~^ ERROR explicit lifetime required in the type of `lexer` [E0621]
|
|
}
|
|
}
|
|
|
|
fn main() {}
|