class Token {
final TokenType type;
final String lexeme;
final Object literal;
public String toString() {
return type + " " + lexeme + " " + literal;
}
}
In the case of “NUMBER 42.40 42.4”, the lexeme is "42.40". It is just a raw string from the source code, and you don’t need to change it in any way:
However, I think my concern is still valid because I initially had a successful codecrafters test then when I tried to run the test again it failed even though I just added a debug print.
So that meant my code was wrong but the test also gave a false positive when it succeeded initially. Am I correct?