aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-07-09 15:27:45 +0100
committerGitHub <noreply@github.com>2024-07-09 15:27:45 +0100
commit9782d7b928a0aea4ed86f6a51ef8593bcc14fb7e (patch)
treebf26703022465f3902fbf4fc5e29da54ba61e1ba /src/parser.cpp
parent9575d85f1aadf6ad501328990b9017d825096750 (diff)
parent5627af582a7882c640f0f4c5b285bafb6377fce1 (diff)
Merge pull request #3896 from odin-lang/cached-builds
Internal Cached Builds
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp10
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;
}