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

Function unexpectedTokenError

src/parser/utils.ts:36–42  ·  view source on GitHub ↗
(token: TokenKind, pos: Ast.Pos, info?: unknown)

Source from the content-addressed store, hash-verified

34}
35
36export function unexpectedTokenError(token: TokenKind, pos: Ast.Pos, info?: unknown): AiScriptError {
37 if (token === TokenKind.EOF) {
38 return new AiScriptUnexpectedEOFError(pos, info);
39 } else {
40 return new AiScriptSyntaxError(`unexpected token: ${TokenKind[token]}`, pos, info);
41 }
42}

Callers 9

expectMethod · 0.85
parseDefStatementFunction · 0.85
parseVarDefFunction · 0.85
parsePrefixFunction · 0.85
parseInfixFunction · 0.85
parsePostfixFunction · 0.85
parseAtomFunction · 0.85
parseObjectKeyFunction · 0.85
expectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected