Update the tokenizer to skip whitespaces
This commit is contained in:
parent
16fb04b737
commit
ed6ff9ba92
@ -39,7 +39,10 @@ char **tokenise(char *line, int *numTokens) {
|
||||
if (*c == ',' && !inBracket) {
|
||||
*c = '\0';
|
||||
tokens[(*numTokens)++] = currentToken;
|
||||
currentToken = c + 2; // Skip ", "
|
||||
currentToken = c + 1;
|
||||
while (*currentToken == ' ') {
|
||||
currentToken++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +88,10 @@ char **tokeniseOperands(char *line, int *numTokens) {
|
||||
if (*c == ',' && !inBracket) {
|
||||
*c = '\0';
|
||||
tokens[(*numTokens)++] = currentToken;
|
||||
currentToken = c + 2; // Skip ", "
|
||||
currentToken = c + 1;
|
||||
while (*currentToken == ' ') {
|
||||
currentToken++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user