Given a stream that is advanced to the first contained character in an open comment, consume the comment. Optionally, if we are allowed, recurse so that we understand comments within this current comment. At this level, we do not support version-condition comments. We might have been called with having just passed one in the stream, though. In that case, we probably want to toler
| 855 | @retval Whether EOF reached before comment is closed. |
| 856 | */ |
| 857 | bool consume_comment(Lex_input_stream *lip, int remaining_recursions_permitted) |
| 858 | { |
| 859 | reg1 uchar c; |
| 860 | while (! lip->eof()) |
| 861 | { |
| 862 | c= lip->yyGet(); |
| 863 | |
| 864 | if (remaining_recursions_permitted > 0) |
| 865 | { |
| 866 | if ((c == '/') && (lip->yyPeek() == '*')) |
| 867 | { |
| 868 | lip->yySkip(); /* Eat asterisk */ |
| 869 | consume_comment(lip, remaining_recursions_permitted-1); |
| 870 | continue; |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | if (c == '*') |
| 875 | { |
| 876 | if (lip->yyPeek() == '/') |
| 877 | { |
| 878 | lip->yySkip(); /* Eat slash */ |
| 879 | return FALSE; |
| 880 | } |
| 881 | } |
| 882 | |
| 883 | if (c == '\n') |
| 884 | lip->yylineno++; |
| 885 | } |
| 886 | |
| 887 | return TRUE; |
| 888 | } |
| 889 | |
| 890 | |
| 891 | /* |
no test coverage detected