Limited comment length to 10 characters

This commit is contained in:
Gašper Dobrovoljc 2025-06-03 22:20:10 +02:00
parent 1b45d6a0f9
commit b325647ad9
No known key found for this signature in database
GPG Key ID: 0E7E037018CFA5A5
3 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,4 +3,3 @@ out/
*.zip
prg/**/*.ast
prg/**/*.out
prg/**/*.pins25

2
prg/test.pins25 Normal file
View File

@ -0,0 +1,2 @@
//1234567890
//12345678901

View File

@ -246,8 +246,14 @@ public class LexAn implements AutoCloseable {
buffToken = new Token(start, Token.Symbol.DIV, "/");
return;
}
nextChar();
int length = 0;
while (buffChar != '\n' && buffChar != -1) {
length++;
if (length > 10) {
throw new Report.Error(currentLocation(), "Comments can only be 10 characters long");
}
nextChar();
}