commit 6d4badd37658db4818e537e6f60f5eaf32fe0d58
parent bec65ea41fc70098f3ad8def1f749df019a59245
Author: sin <sin@2f30.org>
Date: Sun, 11 May 2014 14:51:53 +0100
Handle comments correctly
Diffstat:
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lexer.c b/lexer.c
@@ -53,7 +53,6 @@ struct tok
gettok(FILE *in)
{
struct tok tok;
- char *tmp;
int c;
again:
@@ -208,11 +207,8 @@ again:
ungetc(*e, in);
return tok;
case State_Comment:
- tmp = strchr(s, '\n');
- if (tmp) {
- state = State_Se;
- s = tmp;
- }
+ if (*e == '\n')
+ goto again;
break;
case State_Illegal_Input:
tok.type = Error;