This commit is contained in:
EvilPudding
2016-02-24 20:19:05 +00:00
2 changed files with 8 additions and 5 deletions

View File

@@ -111,7 +111,7 @@ static const te_variable functions[] = {
{0}
};
static const te_variable *find_function(const char *name, int len) {
static const te_variable *find_builtin(const char *name, int len) {
int imin = 0;
int imax = sizeof(functions) / sizeof(te_variable) - 2;
@@ -133,7 +133,7 @@ static const te_variable *find_function(const char *name, int len) {
}
static const te_variable *find_var(const state *s, const char *name, int len) {
static const te_variable *find_lookup(const state *s, const char *name, int len) {
int i;
if (!s->lookup) return 0;
for (i = 0; i < s->lookup_len; ++i) {
@@ -176,8 +176,8 @@ void next_token(state *s) {
start = s->next;
while ((s->next[0] >= 'a' && s->next[0] <= 'z') || (s->next[0] >= '0' && s->next[0] <= '9')) s->next++;
const te_variable *var = find_var(s, start, s->next - start);
if (!var) var = find_function(start, s->next - start);
const te_variable *var = find_lookup(s, start, s->next - start);
if (!var) var = find_builtin(start, s->next - start);
if (!var) {
s->type = TOK_ERROR;
@@ -381,7 +381,7 @@ static te_expr *list(state *s) {
while (s->type == TOK_SEP) {
next_token(s);
ret = new_expr(TE_FUN | 2, (const te_expr*[]){ret, term(s)});
ret = new_expr(TE_FUN | 2, (const te_expr*[]){ret, expr(s)});
ret->fun.f2 = comma;
}