Skip to content

Commit 4f67e34

Browse files
author
Heitor Danilo
committed
chore: renaming next_token to consume_token
1 parent b7e29a6 commit 4f67e34

File tree

4 files changed

+4
-18
lines changed

4 files changed

+4
-18
lines changed

src/lexer/def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ struct Lexer {
1313
int line;
1414
int column;
1515

16-
void (*next_char)(struct Lexer *self);
16+
void (*consume_char)(struct Lexer *self);
1717
char *(*read_sequence)(struct Lexer *self);
1818
void (*jump_whitespace)(struct Lexer *self);
1919
byte (*peek_prev_char)(struct Lexer *self);
2020
byte (*peek_next_char)(struct Lexer *self);
2121

22-
struct Token *(*next_token)(struct Lexer *lex);
22+
struct Token *(*consume_token)(struct Lexer *lex);
2323
};
2424

2525
#endif /* LEXER_DEF_H */

src/parser/token_operations.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
void __PARSER_consume_token(struct Parser *self) {
1919
self->curr_token = self->next_token;
20-
self->next_token = self->lexer->next_token(self->lexer);
20+
self->next_token = self->lexer->consume_token(self->lexer);
2121
}
2222

2323
/**

src/parser/utils.c

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/token/token_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void are_tokens_equal(char* input, struct Token expected_tokens[], int number_of
3131

3232
struct Token *tok;
3333
for (int i = 0; tok->code != END_OF_FILE; i++) {
34-
tok = lexer->next_token(lexer);
34+
tok = lexer->consume_token(lexer);
3535
push_token(tokens, tok);
3636
++number_of_tokens;
3737
}

0 commit comments

Comments
 (0)