From 99080d41f3c02dbc179db8ebb0f215d199f49c89 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 25 Jul 2021 13:06:09 +0100 Subject: INTERNAL USE ONLY: `//+lazy` build flag --- src/parser.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/parser.cpp') 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; } } -- cgit v1.2.3