diff options
| author | gingerBill <bill@gingerbill.org> | 2024-07-09 14:16:56 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-07-09 14:16:56 +0100 |
| commit | 886ee66e7fcabbd09c20fd55d98051e3854dfd76 (patch) | |
| tree | 42009ae0ef71a2c755eb375416143a77d4240c77 /src/parser.cpp | |
| parent | 68b70a21831b3128828357e8af366a377283fa80 (diff) | |
Cache files, env, and args
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 548e46cbe..eb012e980 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -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; } |