MCPcopy Create free account
hub / github.com/arialang/aria / match_pattern

Method match_pattern

lsp/src/parser.rs:553–582  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

551 }
552
553 fn match_pattern(&mut self) {
554 let m = self.open();
555
556 match self.nth(0) {
557 CaseKwd => {
558 self.expect(CaseKwd);
559 self.expect(Identifier);
560 if self.at(LeftParen) {
561 self.expect(LeftParen);
562 self.expect(Identifier);
563 if self.at(Colon) {
564 self.expect(Colon);
565 let _ = self.expr();
566 }
567 self.expect(RightParen);
568 }
569 }
570 Equal | NotEqual | IsaKwd => {
571 self.advance(); // comparison operator
572 let _ = self.expr();
573 }
574 Less | LessEqual | Greater | GreaterEqual => {
575 self.advance(); // relational operator
576 let _ = self.expr();
577 }
578 _ => self.advance_with_error(MatchPattern),
579 }
580
581 self.close(m, MatchPattern);
582 }
583
584 fn stmt_while(&mut self) {
585 assert!(self.at(WhileKwd));

Callers 1

match_ruleMethod · 0.80

Calls 8

openMethod · 0.80
nthMethod · 0.80
expectMethod · 0.80
atMethod · 0.80
exprMethod · 0.80
advanceMethod · 0.80
advance_with_errorMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected