X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=lexer.c;h=5ca734a9256a171d0ac75c1898de04d0b8dc96c2;hb=43298905d2d0a8eabe545794d056bbd7a104b9bf;hp=10bca9d9c72f6239d7c0baeefa697b9d0dd8ec7c;hpb=43e48b16faa9d8bc68a25656648842f90f9977c6;p=cparser diff --git a/lexer.c b/lexer.c index 10bca9d..5ca734a 100644 --- a/lexer.c +++ b/lexer.c @@ -1150,7 +1150,10 @@ static void skip_multiline_comment(void) case '/': next_char(); if (c == '*') { - /* TODO: nested comment, warn here */ + /* nested comment, warn here */ + if (warning.comment) { + warningf(&lexer_token.source_position, "'/*' within comment"); + } } break; case '*': @@ -1192,6 +1195,15 @@ static void skip_line_comment(void) case '\r': return; + case '\\': + next_char(); + if (c == '\n' || c == '\r') { + if (warning.comment) + warningf(&lexer_token.source_position, "multi-line comment"); + return; + } + break; + default: next_char(); break;