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

Method expect

src/parser/streams/token-stream.ts:132–136  ·  view source on GitHub ↗

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

(kind: TokenKind)

Source from the content-addressed store, hash-verified

130 * 一致しなかった場合には文法エラーを発生させます。
131 */
132 public expect(kind: TokenKind): void {
133 if (!this.is(kind)) {
134 throw unexpectedTokenError(this.getTokenKind(), this.getPos());
135 }
136 }
137
138 private load(): void {
139 if (this.eof) {

Callers 1

parseAtomFunction · 0.95

Calls 4

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

Tested by

no test coverage detected