Parser -> slash in end of line

This commit is contained in:
jeffcheasey88 2023-07-21 20:16:14 +02:00
parent 8ba4f91740
commit 4f09edca46

View file

@ -60,7 +60,7 @@ public class JavaParser extends Parser<JavaElement> {
i = j-1; i = j-1;
}else if(Character.isWhitespace(c)) continue; }else if(Character.isWhitespace(c)) continue;
else{ else{
if(c == '/' && line.charAt(i+1) == '/') break; if(c == '/' && (i == line.length()-1 || line.charAt(i+1) == '/')) break;
token = new Token(lineNumber, i+1, ""+c, TokenType.DELIMITER); token = new Token(lineNumber, i+1, ""+c, TokenType.DELIMITER);
} }
this.tokens.add(token); this.tokens.add(token);