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

Function parseOptionalSeparator

src/parser/syntaxes/common.ts:162–179  ·  view source on GitHub ↗
(s: ITokenStream)

Source from the content-addressed store, hash-verified

160 * ```
161*/
162export function parseOptionalSeparator(s: ITokenStream): boolean {
163 switch (s.getTokenKind()) {
164 case TokenKind.NewLine: {
165 s.next();
166 return true;
167 }
168 case TokenKind.Comma: {
169 s.next();
170 if (s.is(TokenKind.NewLine)) {
171 s.next();
172 }
173 return true;
174 }
175 default: {
176 return false;
177 }
178 }
179}

Callers 2

parseMatchFunction · 0.85
parseTypeParamsFunction · 0.85

Calls 3

getTokenKindMethod · 0.65
nextMethod · 0.65
isMethod · 0.65

Tested by

no test coverage detected