use crate::{Token, Tree, Val}; grammar<'s>(); pub(crate) Trees = Tree*; Tree: Tree<'s> = { "(" ")" => Tree::Branch(<>), Val => Tree::Leaf(<>) } Val: Val<'s> = { "@int" => Val::Int(<>), "@float" => Val::Float(<>), "@id" => Val::Ident(<>), } extern { type Location = usize; type Error = crate::LexError; enum Token<'s> { "(" => Token::Lparen, ")" => Token::Rparen, "@id" => Token::Ident(<&'s str>), "@int" => Token::Int(), "@float" => Token::Float(), } }