diff options
Diffstat (limited to 'lex.c')
| -rw-r--r-- | lex.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lex.c b/lex.c index 29b56f0..7c17b33 100644 --- a/lex.c +++ b/lex.c @@ -23,7 +23,6 @@ #include <string.h> -static struct tok storage; struct tok curtok; static int isunget; ulong curline; @@ -220,16 +219,14 @@ gettok(void) { int ch; - curtok.info = (struct tinfo){NULL, 0, 0}; - if (isunget) { isunget = 0; - curtok = storage; - /*say("reread %s(`%s')", tokname(curtok.type), curtok.info.p)*/; return curtok.type; } + curtok.info = (struct tinfo){NULL, 0, 0}; + for (; (ch = get()) != EOF; curtok.info.len = 0) if (!isspace(ch)) goto found; @@ -242,14 +239,12 @@ found: else oper(); - /*say("read %s(`%s')", tokname(curtok.type), curtok.info.p)*/; return curtok.type; } void ungettok() { - storage = curtok; isunget = 1; } |