Struct Lexer
Source pub struct Lexer<'a> {
pub s: &'a str,
}
34fn main() {
35 let l = Lexer::new(TEST);
36 let mut p = Parser::new(l);
37 let a = p.parse();
38 println!("{:#?}", a);
39}
More examples
Hide additional examples
50fn main() {
51 let l = Lexer::new(TEST);
52 let mut p = Parser::new(l);
53 let a = p.parse();
54 println!("{:#?}", a);
55}
35fn main() {
36 let l = Lexer::new(TEST);
37 let mut p = Parser::new(l);
38 let a = p.parse();
39 println!("{:#?}", a);
40}
29fn main() {
30 let l = Lexer::new(TEST);
31 let mut p = Parser::new(l);
32 let a = p.parse();
33 println!("{:#?}", a);
34}
4fn main() {
5 let args: Vec<String> = std::env::args().collect();
6 if args.len() < 2 {
7 panic!("Expected a file input!");
8 }
9 let s = std::fs::read_to_string(&args[1]).expect("Failed to read file!");
10 let l = Lexer::new(&s);
11 let mut p = Parser::new(l);
12 let a = p.parse();
13 println!("{:#?}", a);
14}
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.