mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 09:24:33 +00:00
Cache files, env, and args
This commit is contained in:
@@ -787,6 +787,9 @@ gb_internal Ast *ast_basic_directive(AstFile *f, Token token, Token name) {
|
||||
Ast *result = alloc_ast_node(f, Ast_BasicDirective);
|
||||
result->BasicDirective.token = token;
|
||||
result->BasicDirective.name = name;
|
||||
if (string_starts_with(name.string, str_lit("load"))) {
|
||||
f->seen_load_directive_count++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -6576,6 +6579,13 @@ gb_internal ParseFileError parse_packages(Parser *p, String init_filename) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (AstPackage *pkg : p->packages) {
|
||||
for (AstFile *file : pkg->files) {
|
||||
p->total_seen_load_directive_count += file->seen_load_directive_count;
|
||||
}
|
||||
}
|
||||
|
||||
return ParseFile_None;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user