AutoTest -> 54.633%

This commit is contained in:
jeffcheasey88 2023-07-26 11:23:46 +02:00
parent 97e0465628
commit e0e78c2612

View file

@ -48,12 +48,12 @@ public class JavaParser extends Parser<JavaElement> {
for(int i = 0; i < line.length(); i++){
char c = line.charAt(i);
Token token;
if(Character.isAlphabetic(c) || Character.isDigit(c)){
if(isNameValid(c)){
String value = "";
int j = i;
for(; j < line.length(); j++){
c = line.charAt(j);
if(Character.isAlphabetic(c) || Character.isDigit(c)) value+=c;
if(isNameValid(c)) value+=c;
else break;
}
token = new Token(lineNumber, i+1, value, TokenType.NAME);
@ -67,8 +67,13 @@ public class JavaParser extends Parser<JavaElement> {
}
}
}
private boolean isNameValid(char c) {
return Character.isAlphabetic(c) || Character.isDigit(c) || c == '_' || c == '$';
}
};
//SUMMARY
//- Modifier
//- Type