aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-07-25 13:06:09 +0100
committergingerBill <bill@gingerbill.org>2021-07-25 13:06:09 +0100
commit99080d41f3c02dbc179db8ebb0f215d199f49c89 (patch)
tree85b97e030cda198d83681d20a6710c53494376cf /src/parser.cpp
parent92f3567ee6e28ac07f237e9dbe7287436954877b (diff)
INTERNAL USE ONLY: `//+lazy` build flag
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index e45195578..b22d063d2 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -5312,7 +5312,18 @@ bool parse_file(Parser *p, AstFile *f) {
return false;
}
} else if (lc == "+private") {
- f->is_private = true;
+ f->flags |= AstFile_IsPrivate;
+ } else if (lc == "+lazy") {
+ if (build_context.ignore_lazy) {
+ // Ignore
+ } else if (f->flags & AstFile_IsTest) {
+ // Ignore
+ } else if (build_context.command_kind == Command_doc &&
+ f->pkg->kind == Package_Init) {
+ // Ignore
+ } else {
+ f->flags |= AstFile_IsLazy;
+ }
}
}
}
@@ -5405,7 +5416,7 @@ ParseFileError process_imported_file(Parser *p, ImportedFile const &imported_fil
String test_suffix = str_lit("_test");
if (string_ends_with(name, test_suffix) && name != test_suffix) {
- file->is_test = true;
+ file->flags |= AstFile_IsTest;
}
}