Whether a real operand follows the operator. Comments and line breaks are transparent, so scalac reads the next real token across them. A comment-only tail to EOF, a closing delimiter and a list separator are all no operand.
| 714 | // transparent, so scalac reads the next real token across them. A comment-only |
| 715 | // tail to EOF, a closing delimiter and a list separator are all no operand. |
| 716 | static bool has_operand(TSLexer *lexer) { |
| 717 | for (;;) { |
| 718 | if (lexer->eof(lexer)) { |
| 719 | return false; |
| 720 | } |
| 721 | if (is_space(lexer->lookahead)) { |
| 722 | advance(lexer); |
| 723 | continue; |
| 724 | } |
| 725 | if (lexer->lookahead != '/') { |
| 726 | return !is_close_or_separator(lexer->lookahead); |
| 727 | } |
| 728 | advance(lexer); |
| 729 | if (lexer->lookahead == '/') { |
| 730 | while (!lexer->eof(lexer) && lexer->lookahead != '\n') { |
| 731 | advance(lexer); |
| 732 | } |
| 733 | continue; |
| 734 | } |
| 735 | if (lexer->lookahead != '*') { |
| 736 | return true; // a lone '/' is code |
| 737 | } |
| 738 | advance(lexer); |
| 739 | consume_block_comment_body(lexer); |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | // Blanks and then something that can be the right operand. |
| 744 | static bool operand_follows(TSLexer *lexer) { |
no test coverage detected