MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / parseMatchCase

Function parseMatchCase

src/parser/syntaxes/expressions.ts:495–503  ·  view source on GitHub ↗

* ```abnf * MatchCase = "case" Expr "=>" BlockOrStatement * ```

(s: ITokenStream)

Source from the content-addressed store, hash-verified

493 * ```
494*/
495function parseMatchCase(s: ITokenStream): Ast.Match['qs'][number] {
496 s.expect(TokenKind.CaseKeyword);
497 s.next();
498 const q = parseExpr(s, false);
499 s.expect(TokenKind.Arrow);
500 s.next();
501 const a = parseBlockOrStatement(s);
502 return { q, a };
503}
504
505/**
506 * ```abnf

Callers 1

parseMatchFunction · 0.85

Calls 4

parseExprFunction · 0.85
parseBlockOrStatementFunction · 0.85
expectMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected