diff options
Diffstat (limited to 'gcc/d/dmd/module.h')
-rw-r--r-- | gcc/d/dmd/module.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gcc/d/dmd/module.h b/gcc/d/dmd/module.h index 379e8e6..e178014 100644 --- a/gcc/d/dmd/module.h +++ b/gcc/d/dmd/module.h @@ -1,6 +1,6 @@ /* Compiler implementation of the D programming language - * Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved + * Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved * written by Walter Bright * https://www.digitalmars.com * Distributed under the Boost Software License, Version 1.0. @@ -28,6 +28,14 @@ enum PKG PKGpackage // already determined that's an actual package }; +enum class Edition : unsigned char +{ + none = 0u, + legacy = 1u, + v2024 = 2u, + latest = 2u, +}; + class Package : public ScopeDsymbol { public: @@ -39,8 +47,6 @@ public: bool equals(const RootObject * const o) const override; - Package *isPackage() override final { return this; } - bool isAncestorPackageOf(const Package * const pkg) const; void accept(Visitor *v) override { v->visit(this); } @@ -75,6 +81,7 @@ public: FileType filetype; // source file type d_bool hasAlwaysInlines; // contains references to functions that must be inlined d_bool isPackageFile; // if it is a package.d + Edition edition; // language edition that this module is compiled with Package *pkg; // if isPackageFile is true, the Package that contains this package.d Strings contentImportedFiles; // array of files whose content was imported int needmoduleinfo; @@ -100,11 +107,9 @@ public: Modules aimports; // all imported modules - unsigned debuglevel; // debug level Identifiers *debugids; // debug identifiers Identifiers *debugidsNot; // forward referenced debug identifiers - unsigned versionlevel; // version level Identifiers *versionids; // version identifiers Identifiers *versionidsNot; // forward referenced version identifiers @@ -116,10 +121,10 @@ public: static Module* create(const char *arg, Identifier *ident, int doDocComment, int doHdrGen); static const char *find(const char *filename); - static Module *load(const Loc &loc, Identifiers *packages, Identifier *ident); + static Module *load(Loc loc, Identifiers *packages, Identifier *ident); const char *kind() const override; - bool read(const Loc &loc); // read file, returns 'true' if succeed, 'false' otherwise. + bool read(Loc loc); // read file, returns 'true' if succeed, 'false' otherwise. Module *parse(); // syntactic parse int needModuleInfo(); bool isPackageAccessible(Package *p, Visibility visibility, SearchOptFlags flags = (SearchOptFlags)SearchOpt::all) override; @@ -151,7 +156,6 @@ public: void *ctfe_cov; // stores coverage information from ctfe - Module *isModule() override { return this; } void accept(Visitor *v) override { v->visit(this); } }; |