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

Method expect

src/parser/scanner.ts:102–106  ·  view source on GitHub ↗

* カーソル位置にあるトークンの種類が指定したトークンの種類と一致することを確認します。 * 一致しなかった場合には文法エラーを発生させます。

(kind: TokenKind)

Source from the content-addressed store, hash-verified

100 * 一致しなかった場合には文法エラーを発生させます。
101 */
102 public expect(kind: TokenKind): void {
103 if (!this.is(kind)) {
104 throw unexpectedTokenError(this.getTokenKind(), this.getPos());
105 }
106 }
107
108 private readToken(): Token {
109 let hasLeftSpacing = false;

Callers

nothing calls this directly

Calls 4

isMethod · 0.95
getTokenKindMethod · 0.95
getPosMethod · 0.95
unexpectedTokenErrorFunction · 0.85

Tested by

no test coverage detected