commit 85261cadcde2f1b41211dd666c2caec6732a204a
parent 9539419a2015c425987e74556e2dbf94e1887af5
Author: sin <sin@2f30.org>
Date: Wed, 14 May 2014 13:50:50 +0100
Rename pushbacktok() to puttok()
Diffstat:
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lexer.c b/lexer.c
@@ -46,6 +46,7 @@ gettok(FILE *in)
struct tok tok;
int c;
+ /* if we pushed back a token, return it now */
if (pendingtok == 1) {
pendingtok = 0;
return lasttok;
@@ -248,7 +249,7 @@ lexeme(struct tok *t)
}
void
-pushbacktok(struct tok t)
+puttok(struct tok t)
{
lasttok = t;
pendingtok = 1;
diff --git a/lexer.h b/lexer.h
@@ -21,4 +21,4 @@ struct tok {
struct tok gettok(FILE *fp);
char *lexeme(struct tok *);
-void pushbacktok(struct tok);
+void puttok(struct tok);
diff --git a/parser.c b/parser.c
@@ -173,7 +173,7 @@ pair(FILE *in)
t = gettok(in);
if (t.type == TRparen)
return emptylist();
- pushbacktok(t);
+ puttok(t);
car = sexpression(in);
t = gettok(in);
if (t.type == TDot) {
@@ -183,7 +183,7 @@ pair(FILE *in)
return error("missing right parenthesis");
return cons(car, cdr);
}
- pushbacktok(t);
+ puttok(t);
cdr = pair(in);
return cons(car, cdr);
}