iris

small scheme interpreter
git clone git://git.2f30.org/iris
Log | Files | Refs | LICENSE

commit 689beeb53d4fce5e8b5c51b3db367839dcb1e069
parent 886ce4808152a7d4685b4a31e7091358a730278e
Author: sin <sin@2f30.org>
Date:   Fri,  9 May 2014 16:36:13 +0100

Rename tok to t where it makes sense

Diffstat:
Mdebug.c | 8++++----
Mlexer.c | 12++++++------
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/debug.c b/debug.c @@ -5,14 +5,14 @@ #include "debug.h" void -printtok(struct tok *tok) +printtok(struct tok *t) { char *s; - s = extractstring(tok); + s = extractstring(t); if (!s) return; - switch (tok->type) { + switch (t->type) { case Error: printf("Error: '%s'", s); break; @@ -47,7 +47,7 @@ printtok(struct tok *tok) printf("Dot: '%s'", s); break; default: - printf("Unknown token type: %d", tok->type); + printf("Unknown ten type: %d", t->type); break; } free(s); diff --git a/lexer.c b/lexer.c @@ -30,14 +30,14 @@ delim(int c) } char * -extractstring(struct tok *tok) +extractstring(struct tok *t) { - if (tok->s == NULL) + if (t->s == NULL) return NULL; - /* In this case, tok->s is null-terminated */ - if (tok->e == NULL) - return strdup(tok->s); - return strndup(tok->s, tok->e - tok->s); + /* In this case, t->s is null-terminated */ + if (t->e == NULL) + return strdup(t->s); + return strndup(t->s, t->e - t->s); } struct tok