Actually just three programming languages in a trenchcoat
at string-repr-callable 17 lines 458 B view raw
1use super::*; 2use crate::Parser; 3use trilogy_scanner::{Token, TokenType}; 4 5#[derive(Clone, Debug, Spanned, PrettyPrintSExpr)] 6pub struct PinnedPattern { 7 pub pin: Token, 8 pub identifier: Identifier, 9} 10 11impl PinnedPattern { 12 pub(crate) fn parse(parser: &mut Parser) -> SyntaxResult<Self> { 13 let pin = parser.expect(TokenType::OpCaret).unwrap(); 14 let identifier = Identifier::parse(parser)?; 15 Ok(Self { pin, identifier }) 16 } 17}