MCPcopy Index your code
hub / github.com/aiscript-dev/aiscript / parseDefStatement

Function parseDefStatement

src/parser/syntaxes/statements.ts:73–86  ·  view source on GitHub ↗
(s: ITokenStream)

Source from the content-addressed store, hash-verified

71 * ```
72*/
73export function parseDefStatement(s: ITokenStream): Ast.Definition {
74 switch (s.getTokenKind()) {
75 case TokenKind.VarKeyword:
76 case TokenKind.LetKeyword: {
77 return parseVarDef(s);
78 }
79 case TokenKind.At: {
80 return parseFnDef(s);
81 }
82 default: {
83 throw unexpectedTokenError(s.getTokenKind(), s.getPos());
84 }
85 }
86}
87
88/**
89 * ```abnf

Callers 1

parseNamespaceFunction · 0.85

Calls 5

parseVarDefFunction · 0.85
parseFnDefFunction · 0.85
unexpectedTokenErrorFunction · 0.85
getTokenKindMethod · 0.65
getPosMethod · 0.65

Tested by

no test coverage detected