Actually just three programming languages in a trenchcoat
at string-repr-callable 17 lines 357 B view raw
1use crate::Parser; 2use trilogy_scanner::{Token, TokenType::*}; 3 4#[derive(Clone, Debug, PrettyPrintSExpr)] 5pub enum MutModifier { 6 Not, 7 Mut(Token), 8} 9 10impl MutModifier { 11 pub(crate) fn parse(parser: &mut Parser) -> Self { 12 parser 13 .expect(KwMut) 14 .map(MutModifier::Mut) 15 .unwrap_or(MutModifier::Not) 16 } 17}