Skip to content

Commit

Permalink
Remove recursion for comment parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
QuickWrite committed Nov 27, 2024
1 parent b9b7a2e commit da4ba30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ char* get_identifier(FILE* const fptr, int c) {
}

void next_token(struct Lexer* const lexer) {
start:
skip_whitespace(lexer->fptr);

struct Token next;
Expand All @@ -101,8 +102,7 @@ void next_token(struct Lexer* const lexer) {
// This is a comment. It should not be returned as a token as it is completely useless for a parser
skip_comment(lexer->fptr);

next_token(lexer);
return;
goto start;

case '=':
next = new_token(TOK_EQUALS);
Expand Down

0 comments on commit da4ba30

Please sign in to comment.