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 '*':
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;