()
| 434 | // Note that this function always returned the un-flagged token! |
| 435 | // The flags, if any, are saved in currentFlaggedToken. |
| 436 | private int peekToken() throws IOException { |
| 437 | // By far the most common case: last token hasn't been consumed, |
| 438 | // so return already-peeked token. |
| 439 | if (currentFlaggedToken != Token.EOF) { |
| 440 | return currentToken; |
| 441 | } |
| 442 | |
| 443 | int tt = ts.getToken(); |
| 444 | boolean sawEOL = false; |
| 445 | |
| 446 | // process comments and whitespace |
| 447 | while (tt == Token.EOL || tt == Token.COMMENT) { |
| 448 | if (tt == Token.EOL) { |
| 449 | sawEOL = true; |
| 450 | tt = ts.getToken(); |
| 451 | } else { |
| 452 | if (compilerEnv.isRecordingComments()) { |
| 453 | String comment = ts.getAndResetCurrentComment(); |
| 454 | recordComment(ts.getTokenStartLineno(), ts.getTokenColumn(), comment); |
| 455 | break; |
| 456 | } |
| 457 | tt = ts.getToken(); |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | currentToken = tt; |
| 462 | currentFlaggedToken = tt | (sawEOL ? TI_AFTER_EOL : 0); |
| 463 | return currentToken; // return unflagged token |
| 464 | } |
| 465 | |
| 466 | private int lineNumber() { |
| 467 | return lastTokenLineno; |
no test coverage detected