diff --git a/lexer.c b/lexer.c index 1e6d0d5..7f00a0f 100644 --- a/lexer.c +++ b/lexer.c @@ -8,13 +8,15 @@ Cursor cursor = { }; char* nextchar(void){ - if (cursor.chunk >= page.len) return NULL; + if (cursor.chunk >= page.len){ + return NULL; + } if (page.chunks[cursor.chunk][cursor.offset+1] == '\0'){ cursor.chunk++; cursor.offset = 0; } else { cursor.offset++; - } + } return &page.chunks[cursor.chunk][cursor.offset]; } @@ -23,17 +25,6 @@ Token* nexttoken(void){ Token* token = malloc(sizeof(Token)); token->type = NO_TYPE; - /* - while (nextchar() == '<'); - - char c = '\0'; - do { - c = nextchar(); - printf("%c", c);; - } while (c != '>'); - puts(""); - */ - puts(""); char* c = nextchar(); do {