Skip to content

Commit ce81035

Browse files
authored
[spec] Fix missing legacy.html (#3719)
* [spec] Fix generating legacy.html Also fix missing/wrong Previous/Next items. * Remove non-standard macros; minor tweaks * Fix missing H2 warning * `-wo` does nothing after #15612 * Remove `body` from deprecate.dd
1 parent b73beab commit ce81035

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

deprecate.dd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ $(SPEC_S Deprecated Features,
1111
$(TABLE2 Deprecated Features,
1212
$(THEAD Feature, Spec, Dep, Error, Gone)
1313
$(TROW $(DEPLINK Throwing from contracts of nothrow functions),  , 2.101, 2.111,  )
14-
$(TROW $(DEPLINK body keyword), 2.075, 2.097, 2.097, 2.117)
1514
$(TROW $(DEPLINK Hexstring literals), 2.079, 2.079, 2.086,  )
1615
$(TROW $(DEPLINK Class allocators and deallocators),  , 2.080, 2.087, 2.100 )
1716
$(TROW $(DEPLINK Implicit comparison of different enums), 2.075, 2.075, 2.081,  )

posix.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ SPEC_ROOT=$(addprefix spec/, \
322322
const3 function operatoroverloading template template-mixin contracts \
323323
version traits errors unittest garbage float iasm ddoc \
324324
interfaceToC cpp_interface objc_interface portability entity memory-safe-d \
325-
abi simd betterc importc ob windows glossary)
325+
abi simd betterc importc ob windows glossary legacy)
326326
SPEC_DD=$(addsuffix .dd,$(SPEC_ROOT))
327327

328328
CHANGELOG_FILES:=$(basename $(subst _pre.dd,.dd,$(wildcard changelog/*.dd)))

spec/glossary.dd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ void test()
272272
`arg.funct()`.)
273273
)
274274

275+
$(SPEC_SUBNAV_PREV_NEXT windows, Windows Programming, legacy, Legacy Code)
275276
)
276277

277278
Macros:

spec/legacy.dd

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ $(SPEC_S Legacy Code,
55
$(HEADERNAV_TOC)
66

77
$(P To maintain compatibility with older D code, many legacy features remain supported.
8+
$(COMMENT
89
If the $(TT -wo) compiler command line switch is used, the compiler will give warning messages
910
for each use of a legacy feature.
11+
)
1012
This page describes each legacy feature that is supported, with a suggestion of how to
1113
modernize the code.
1214
)
1315

14-
)
15-
1616
$(TABLE2 Legacy Features,
1717
$(THEAD Feature)
18-
$(TROW $(DEPLINK body keyword), usage of identifier $(TT body) as a keyword is obsolete use $(TT do) instead)
18+
$(TROW $(RELATIVE_LINK2 body, `body` keyword), usage of identifier $(TT body) as a keyword is obsolete - use $(TT do) instead)
1919
)
2020

21-
$(H3 $(DEPNAME body keyword))
22-
$(P `body` was a keyword used to specify a function/method's body in the presence of contracts
21+
$(H2 $(LNAME2 body, `body` keyword))
22+
$(P `body` was a keyword used to specify a function/method's body after a contract statement:)
2323
---
2424
class Foo
2525
{
@@ -34,27 +34,26 @@ $(H3 $(DEPNAME body keyword))
3434
void noBody() { /* No contracts, no body */ }
3535
}
3636
---
37-
)
38-
$(H4 Corrective Action)
39-
$(P Use the `do` keyword instead (introduced v2.075.0)
37+
38+
$(H3 Corrective Action)
39+
40+
$(P Use the `do` keyword instead (introduced in v2.075.0):)
4041
---
4142
void bar(int i)
4243
in { assert(i >= 42); }
4344
do { /* Look ma, no body! */ }
4445
---
45-
)
46-
$(H4 Rationale)
47-
$(P The `body` keyword was only used for this single purpose.
46+
47+
$(RATIONALE The `body` keyword was only used for this single purpose.
4848
Since D grammar aims to be context free, this common word was reserved,
4949
which led to frequent trouble for people interfacing with other languages
5050
(e.g. javascript) or auto-generating code.
5151
)
5252

5353

54+
$(SPEC_SUBNAV_PREV glossary, Glossary)
55+
)
56+
5457
Macros:
5558
CHAPTER=45
5659
TITLE=Legacy Code
57-
DEPLINK=$(RELATIVE_LINK2 $0, $0)
58-
DEPLINK2=$(LINK2 $1.html#$2, $2)
59-
DEPNAME=$(LNAME2 $0, $0)
60-
D=<span class="d_inlinecode">$0</span>

spec/windows.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $(H3 $(LNAME2 omf-windows, Windows GUI Programs))
3636

3737
$(H3 $(LNAME2 omf-dlls, DLLs))
3838

39-
$(SPEC_SUBNAV_PREV ob, Live Functions)
39+
$(SPEC_SUBNAV_PREV_NEXT ob, Live Functions, glossary, Glossary)
4040
)
4141

4242
Macros:

0 commit comments

Comments
 (0)