Skip to content

Commit

Permalink
import: Accept global imports
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Oct 29, 2024
1 parent 5d90ccd commit bf02989
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flamingo/grammar/import.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ static int parse_import_path(flamingo_t* flamingo, TSNode node, char** path_ref,

static int parse_import(flamingo_t* flamingo, TSNode node) {
assert(strcmp(ts_node_type(node), "import") == 0);
assert(ts_node_child_count(node) == 3);

size_t const child_count = ts_node_child_count(node);
assert(child_count == 2 || child_count == 3);

// Is the import relative to the current file?
// If so, it means we need to follow the import file relative to the current one.
Expand All @@ -174,8 +176,6 @@ static int parse_import(flamingo_t* flamingo, TSNode node) {

// Parse the import path into an actual string path we can use.

(void) is_relative;

char* path = NULL;
size_t path_len = 0;

Expand Down

0 comments on commit bf02989

Please sign in to comment.