Skip to content

Commit 469c542

Browse files
ntreldlang-bot
authored andcommitted
[module.dd] Use relevant subheadings
Add subheading for 'Deprecated modules'.
1 parent 499e4f2 commit 469c542

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

spec/module.dd

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,22 @@ $(P If the file name of a module is an invalid module name (e.g.
141141
module foo_bar;
142142
---------
143143

144+
$(IMPLEMENTATION_DEFINED
145+
$(OL
146+
$(LI The mapping of package and module identifiers to directory and file names.)
147+
))
148+
149+
$(BEST_PRACTICE
150+
$(OL
151+
$(LI $(GLINK PackageName)s and $(GLINK ModuleName)s should be composed of the ASCII
152+
characters lower case letters, digits or `_` to ensure maximum portability and compatibility with
153+
various file systems.)
154+
$(LI The file names for packages and modules should be composed only of
155+
the ASCII lower case letters, digits, and `_`s, and should not be a $(GLINK_LEX Keyword).)
156+
))
157+
158+
$(H3 $(LNAME2 deprecated_modules, Deprecated modules))
159+
144160
$(P A $(I ModuleDeclaration) can have an optional $(GLINK2 attribute,
145161
DeprecatedAttribute). The compiler will produce a message when the deprecated
146162
module is imported.)
@@ -155,7 +171,7 @@ import foo; // Deprecated: module foo is deprecated
155171
---------
156172

157173
$(P A $(I DeprecatedAttribute) can have an optional $(ASSIGNEXPRESSION) argument to provide a
158-
more informative message. An $(I AssignExpression) must evaluate to a string at compile time.
174+
more informative message. The $(I AssignExpression) must evaluate to a string at compile time.
159175
)
160176

161177
---------
@@ -170,18 +186,9 @@ import foo; // Deprecated: module foo is deprecated - Please use foo2 instead.
170186

171187
$(IMPLEMENTATION_DEFINED
172188
$(OL
173-
$(LI The mapping of package and module identifiers to directory and file names.)
174189
$(LI How the deprecation messages are presented to the user.)
175190
))
176191

177-
$(BEST_PRACTICE
178-
$(OL
179-
$(LI $(GLINK PackageName)s and $(GLINK ModuleName)s should be composed of the ASCII
180-
characters lower case letters, digits or `_` to ensure maximum portability and compatibility with
181-
various file systems.)
182-
$(LI The file names for packages and modules should be composed only of
183-
the ASCII lower case letters, digits, and `_`s, and should not be a $(GLINK_LEX Keyword).)
184-
))
185192

186193
$(H2 $(LEGACY_LNAME2 ImportDeclaration, import-declaration, Import Declaration))
187194

@@ -226,7 +233,7 @@ $(P $(I ModuleFullyQualifiedName)s in the $(I ImportDeclaration) must be fully
226233
qualified with whatever packages they are in. They are not considered to be
227234
relative to the module that imports them.)
228235

229-
$(H2 $(LNAME2 name_lookup, Symbol Name Lookup))
236+
$(H3 $(LNAME2 name_lookup, Symbol Name Lookup))
230237

231238
$(P The simplest form of importing is to just list the modules being imported:)
232239

@@ -317,7 +324,7 @@ void test()
317324
}
318325
---
319326

320-
$(H2 $(LNAME2 public_imports, Public Imports))
327+
$(H3 $(LNAME2 public_imports, Public Imports))
321328

322329
$(P By default, imports are $(I private). This means that if module A imports
323330
module B, and module B imports module C, then names inside C are visible only inside
@@ -363,7 +370,7 @@ X.bar(); // ditto
363370
Y.bar(); // ok, Y.bar() is an alias to X.bar()
364371
---
365372

366-
$(H2 $(LNAME2 static_imports, Static Imports))
373+
$(H3 $(LNAME2 static_imports, Static Imports))
367374

368375
$(P A static import requires the use of a fully qualified name
369376
to reference the module's names:)
@@ -378,7 +385,7 @@ void main()
378385
}
379386
---
380387

381-
$(H2 $(LNAME2 renamed_imports, Renamed Imports))
388+
$(H3 $(LNAME2 renamed_imports, Renamed Imports))
382389

383390
$(P A local name for an import can be given, through which all references to the
384391
module's symbols must be qualified with:)
@@ -398,7 +405,7 @@ void main()
398405

399406
$(BEST_PRACTICE Renamed imports are handy when dealing with very long import names.)
400407

401-
$(H2 $(LNAME2 selective_imports, Selective Imports))
408+
$(H3 $(LNAME2 selective_imports, Selective Imports))
402409

403410
$(P Specific symbols can be exclusively imported from a module and bound into
404411
the current namespace:)
@@ -420,7 +427,7 @@ void main()
420427

421428
$(P $(D static) cannot be used with selective imports.)
422429

423-
$(H2 $(LNAME2 renamed_selective_imports, Renamed and Selective Imports))
430+
$(H3 $(LNAME2 renamed_selective_imports, Renamed and Selective Imports))
424431

425432
$(P When renaming and selective importing are combined:)
426433

@@ -444,7 +451,7 @@ void main()
444451
--------------
445452
)
446453

447-
$(H2 $(LNAME2 scoped_imports, Scoped Imports))
454+
$(H3 $(LNAME2 scoped_imports, Scoped Imports))
448455

449456
$(P Import declarations may be used at any scope. For example:)
450457

@@ -557,7 +564,7 @@ $(H2 $(LNAME2 staticorder, Static Construction and Destruction))
557564
thread local data.)
558565
))
559566

560-
$(H2 $(LNAME2 order_of_static_ctor, Order of Static Construction))
567+
$(H3 $(LNAME2 order_of_static_ctor, Order of Static Construction))
561568

562569
$(P Shared static constructors on all modules are run before any non-shared static
563570
constructors.)
@@ -603,12 +610,12 @@ destructors. Violation of this rule will result in a runtime exception.)
603610
)
604611
)
605612

606-
$(H2 $(LNAME2 order_of_static_ctors, Order of Static Construction within a Module))
613+
$(H3 $(LNAME2 order_of_static_ctors, Order of Static Construction within a Module))
607614

608615
$(P Within a module, static construction occurs in the lexical order in
609616
which they appear.)
610617

611-
$(H2 $(LNAME2 order_static_dtor, Order of Static Destruction))
618+
$(H3 $(LNAME2 order_static_dtor, Order of Static Destruction))
612619

613620
$(P This is defined to be in exactly the reverse order of static construction.
614621
Static destructors for individual modules will only be run if the

0 commit comments

Comments
 (0)