We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 779052b + 1ca3587 commit 8d7ebbbCopy full SHA for 8d7ebbb
tinyexpr.c
@@ -39,6 +39,7 @@ For log = natural log uncomment the next line. */
39
#include <math.h>
40
#include <string.h>
41
#include <stdio.h>
42
+#include <ctype.h>
43
#include <limits.h>
44
45
#ifndef NAN
@@ -245,8 +246,8 @@ void next_token(state *s) {
245
246
if (s->next[0] >= 'a' && s->next[0] <= 'z') {
247
const char *start;
248
start = s->next;
- while ((s->next[0] >= 'a' && s->next[0] <= 'z') || (s->next[0] >= '0' && s->next[0] <= '9') || (s->next[0] == '_')) s->next++;
249
-
+ while (isalpha(s->next[0]) || isdigit(s->next[0]) || (s->next[0] == '_')) s->next++;
250
+
251
const te_variable *var = find_lookup(s, start, s->next - start);
252
if (!var) var = find_builtin(start, s->next - start);
253
0 commit comments