Battling lifetimes, copying, and collections
The Rust Programming Language Forum
Battling lifetimes, copying, and collections
Hey! I'm looking for decent ways to implement a parser and, in particular, the peek function seems, well, kind of hard to implement in rust. I have the following (a reduced example) enum Token { Num(String), Plus, Minux, LParen, RParen, } enum BinOp { Add, Minus, } enum Expr { Binary { op: BinOp, left: Box<Expr>, right: Box<Expr>, }, Num(i64), } struct Parser { current: usize, tokens: Vec<Token>, } And if I want to im...
0 comments
No comments yet.