@@ -199,7 +199,7 @@ export class Tokenizer {
199199
200200 // Is it the "&&" token?
201201 if ( firstChar === '&' ) {
202- if ( this . _peek2 ( ) === '&' ) {
202+ if ( this . _peekTwice ( ) === '&' ) {
203203 this . _get ( ) ;
204204 this . _get ( ) ;
205205 return new Token ( TokenKind . AndIf , input . getNewRange ( startIndex , this . _currentIndex ) ) ;
@@ -221,21 +221,33 @@ export class Tokenizer {
221221 return tokens ;
222222 }
223223
224+ /**
225+ * Retrieve the next character in the input stream.
226+ * @returns a string of length 1, or undefined if the end of input is reached
227+ */
224228 private _get ( ) : string | undefined {
225229 if ( this . _currentIndex >= this . input . end ) {
226230 return undefined ;
227231 }
228232 return this . input . buffer [ this . _currentIndex ++ ] ;
229233 }
230234
235+ /**
236+ * Return the next character in the input stream, but don't advance the stream pointer.
237+ * @returns a string of length 1, or undefined if the end of input is reached
238+ */
231239 private _peek ( ) : string | undefined {
232240 if ( this . _currentIndex >= this . input . end ) {
233241 return undefined ;
234242 }
235243 return this . input . buffer [ this . _currentIndex ] ;
236244 }
237245
238- private _peek2 ( ) : string | undefined {
246+ /**
247+ * Return the character after the next character in the input stream, but don't advance the stream pointer.
248+ * @returns a string of length 1, or undefined if the end of input is reached
249+ */
250+ private _peekTwice ( ) : string | undefined {
239251 if ( this . _currentIndex + 1 >= this . input . end ) {
240252 return undefined ;
241253 }
0 commit comments