Actually just three programming languages in a trenchcoat
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}