Compare commits

...

1 Commits

Author SHA1 Message Date
Gašper Dobrovoljc
30fbde8c31
Added multiline comments 2025-06-03 17:45:56 +02:00

View File

@ -247,8 +247,37 @@ public class LexAn implements AutoCloseable {
return;
}
while (buffChar != '\n' && buffChar != -1) {
nextChar();
if (buffChar == '{') {
int depth = 1;
nextChar();
while (depth > 0) {
switch (buffChar) {
case '}':
nextChar();
if (buffChar != '/') continue;
nextChar();
if (buffChar != '/') continue;
depth--;
break;
case '/':
nextChar();
if (buffChar != '/') continue;
nextChar();
if (buffChar != '{') continue;
depth++;
break;
case -1:
throw new Report.Error(currentLocation(), "Unterminated multiline comment");
default:
nextChar();
}
}
} else {
while (buffChar != '\n' && buffChar != -1) {
nextChar();
}
}
nextToken();