Skip to content

Commit

Permalink
parse identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
omdxp committed Aug 3, 2024
1 parent 8e799e9 commit ba9135d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ int parse_exp(struct history *history) {
return 0;
}

void parse_identifier(struct history *history) {
assert(token_peek_next()->type == TOKEN_TYPE_IDENTIFIER);
parse_single_token_to_node();
}

int parse_expressionable_single(struct history *history) {
struct token *token = token_peek_next();
if (!token) {
Expand All @@ -208,6 +213,10 @@ int parse_expressionable_single(struct history *history) {
parse_exp(history);
res = 0;
break;
case TOKEN_TYPE_IDENTIFIER:
parse_identifier(history);
res = 0;
break;
}
return res;
}
Expand Down

0 comments on commit ba9135d

Please sign in to comment.