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

Function parseDest

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

Source from the content-addressed store, hash-verified

14 * ```
15*/
16export function parseDest(s: ITokenStream): Ast.Expression {
17 // 全部parseExprに任せるとparseReferenceが型注釈を巻き込んでパースしてしまうためIdentifierのみ個別に処理。
18 if (s.is(TokenKind.Identifier)) {
19 const nameStartPos = s.getPos();
20 const name = s.getTokenValue();
21 s.next();
22 return NODE('identifier', { name }, nameStartPos, s.getPos());
23 } else {
24 return parseExpr(s, false);
25 }
26}
27
28/**
29 * ```abnf

Callers 3

parseParamsFunction · 0.85
parseVarDefFunction · 0.85
parseEachFunction · 0.85

Calls 6

NODEFunction · 0.85
parseExprFunction · 0.85
isMethod · 0.65
getPosMethod · 0.65
getTokenValueMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected