Skip to content

Commit

Permalink
Renamed crucial functions (#59 from wesuRage/main)
Browse files Browse the repository at this point in the history
Renamed crucial functions
  • Loading branch information
wesuRage authored Dec 15, 2024
2 parents a11375c + 0531fa9 commit ed17593
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/frontend/parser/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ typedef struct {
Parser parser_new();

bool not_eof(Parser *parser);
Token at(Parser *parser);
Token eat(Parser *parser);
Token next(Parser *parser);
Token current_token(Parser *parser);
Token consume_token(Parser *parser);
Token next_token(Parser *parser);
Token expect(Parser *parser, TokenType expected_type, const char *err);
void error(Parser *parser, const char *message);
AstNode *produce_ast(Parser *parser, Token *tokens, int token_count);
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool not_eof(Parser *parser) {
* @param parser The parser instance.
* @return The current token.
*/
Token at(Parser *parser) {
Token current_token(Parser *parser) {
return parser->tokens[parser->index];
}

Expand All @@ -112,7 +112,7 @@ Token at(Parser *parser) {
* @param parser The parser instance.
* @return The current token before advancing.
*/
Token eat(Parser *parser) {
Token consume_token(Parser *parser) {
return parser->tokens[parser->index++];
}

Expand All @@ -125,7 +125,7 @@ Token eat(Parser *parser) {
* @param parser The parser instance.
* @return The next token in the stream.
*/
Token next(Parser *parser) {
Token next_token(Parser *parser) {
if (parser->index + 1 >= parser->token_count) {
return current_token(parser);
}
Expand Down

0 comments on commit ed17593

Please sign in to comment.