Skip to content

Commit

Permalink
Started using curlies for generics
Browse files Browse the repository at this point in the history
  • Loading branch information
Khhs167 committed Jan 28, 2024
1 parent b6568d0 commit f220262
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ node_identifier* parse_identifier(parser_context* parser) {
}

// If it's not a package access, we first handle generics, then child identifiers.
// TODO: Array access & generics currently interfere w/ each other. Fix.
if(at(parser, TOKEN_BRACKET_OPEN)) {
consume(parser, TOKEN_BRACKET_OPEN);
if(at(parser, TOKEN_BRACE_OPEN)) {
consume(parser, TOKEN_BRACE_OPEN);
while (1) {
// We get the generic value
node* generic = parse_statement(parser, 0);
Expand All @@ -107,8 +106,8 @@ node_identifier* parse_identifier(parser_context* parser) {

consume(parser, TOKEN_COMMA);
}
// And then end it with the closing bracket.
consume(parser, TOKEN_BRACKET_CLOSE);
// And then end it with the closing brace.
consume(parser, TOKEN_BRACE_CLOSE);
}

// Now let's get our child if it exists.
Expand Down

0 comments on commit f220262

Please sign in to comment.