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

Method lookahead

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

* トークンの先読みを行います。カーソル位置は移動されません。

(offset: number)

Source from the content-addressed store, hash-verified

118 * トークンの先読みを行います。カーソル位置は移動されません。
119 */
120 public lookahead(offset: number): Token {
121 if (this.index + offset < this.source.length) {
122 return this.source[this.index + offset]!;
123 } else {
124 return TOKEN(TokenKind.EOF, { line: -1, column: -1 });
125 }
126 }
127
128 /**
129 * カーソル位置にあるトークンの種類が指定したトークンの種類と一致することを確認します。

Callers

nothing calls this directly

Calls 1

TOKENFunction · 0.85

Tested by

no test coverage detected