Allow whitespace at end of expression.

This commit is contained in:
Lewis Van Winkle
2016-08-22 19:09:21 -05:00
parent 4c1015ab7f
commit ec7dc3a28a
2 changed files with 6 additions and 5 deletions

View File

@@ -172,13 +172,13 @@ static double comma(double a, double b) {return b;}
void next_token(state *s) {
s->type = TOK_NULL;
if (!*s->next){
s->type = TOK_END;
return;
}
do {
if (!*s->next){
s->type = TOK_END;
return;
}
/* Try reading a number. */
if ((s->next[0] >= '0' && s->next[0] <= '9') || s->next[0] == '.') {
s->value = strtod(s->next, (char**)&s->next);