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

Function parseBlockOrStatement

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

Source from the content-addressed store, hash-verified

91 * ```
92*/
93export function parseBlockOrStatement(s: ITokenStream): Ast.Statement | Ast.Expression {
94 if (s.is(TokenKind.OpenBrace)) {
95 const startPos = s.getPos();
96 const statements = parseBlock(s);
97 return NODE('block', { statements }, startPos, s.getPos());
98 } else {
99 return parseStatement(s);
100 }
101}
102
103/**
104 * ```abnf

Callers 7

parseEachFunction · 0.85
parseForFunction · 0.85
parseDoWhileFunction · 0.85
parseWhileFunction · 0.85
parseIfFunction · 0.85
parseMatchCaseFunction · 0.85
parseDefaultCaseFunction · 0.85

Calls 5

parseBlockFunction · 0.85
NODEFunction · 0.85
parseStatementFunction · 0.85
isMethod · 0.65
getPosMethod · 0.65

Tested by

no test coverage detected