Skip to content

Commit

Permalink
Tokenizer now skips optional white spaces after function or variable
Browse files Browse the repository at this point in the history
  • Loading branch information
uk committed Aug 10, 2017
1 parent 0188baa commit 3fee741
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/com/udojava/evalex/Expression.java
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@ public Token next() {
token.append(input.charAt(pos++));
ch = pos == input.length() ? 0 : input.charAt(pos);
}
//Remove optional white spaces after function or variable name
if (ch == ' ') {
while (ch == ' ' && pos < input.length()) {
ch = input.charAt(pos++);
}
pos--;
}
token.type = ch == '(' ? TokenType.FUNCTION : TokenType.VARIABLE;
} else if (ch == '(' || ch == ')' || ch == ',') {
if(ch == '(') {
Expand Down

0 comments on commit 3fee741

Please sign in to comment.