Skip to content

Commit 6deb338

Browse files
authored
[spec/declaration.dd] Add grammar headings (#3213)
Add link to DeclDef under Declaration. Add Grammar heading and subheadings. This helps break up a big block of grammar text for easier navigation. Inline *VarDeclaratorIdentifier* and *ExpInitializer* as they are singletons and not referenced anywhere else. It doesn't appear in grammar.dd.
1 parent c8b0e89 commit 6deb338

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

spec/declaration.dd

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ $(SPEC_S Declarations,
44

55
$(HEADERNAV_TOC)
66

7+
$(H2 $(LNAME2 grammar, Grammar))
8+
79
$(GRAMMAR
810
$(GNAME Declaration):
911
$(GLINK2 function, FuncDeclaration)
@@ -18,6 +20,11 @@ $(GNAME Declaration):
1820
$(GLINK2 version, StaticAssert)
1921
)
2022

23+
$(P See also $(GLINK2 module, DeclDef).
24+
)
25+
26+
$(H3 $(LNAME2 aggregates, Aggregates))
27+
2128
$(GRAMMAR
2229
$(GNAME AggregateDeclaration):
2330
$(GLINK2 class, ClassDeclaration)
@@ -26,6 +33,8 @@ $(GNAME AggregateDeclaration):
2633
$(GLINK2 struct, UnionDeclaration)
2734
)
2835

36+
$(H3 $(LNAME2 variable-declarations, Variable Declarations))
37+
2938
$(GRAMMAR
3039
$(GNAME VarDeclarations):
3140
$(GLINK StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK Declarators) $(D ;)
@@ -43,10 +52,7 @@ $(GNAME DeclaratorIdentifierList):
4352
$(GLINK DeclaratorIdentifier)
4453
$(GLINK DeclaratorIdentifier) $(D ,) $(GSELF DeclaratorIdentifierList)
4554

46-
$(GNAME DeclaratorIdentifier):
47-
$(GLINK VarDeclaratorIdentifier)
48-
49-
$(GNAME VarDeclaratorIdentifier):
55+
$(GNAME DeclaratorIdentifier):$(LEGACY_LNAME2 VarDeclaratorIdentifier)
5056
$(GLINK_LEX Identifier)
5157
$(GLINK_LEX Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK Initializer)
5258

@@ -57,6 +63,8 @@ $(GNAME VarDeclarator):
5763
$(GLINK2 type, TypeSuffixes)$(OPT) $(GLINK_LEX Identifier)
5864
)
5965

66+
$(H3 $(LNAME2 storage-classes, Storage Classes))
67+
6068
$(GRAMMAR
6169
$(GNAME StorageClasses):
6270
$(GLINK StorageClass)
@@ -87,19 +95,18 @@ $(MULTICOLS 5, $(GLINK2 attribute, LinkageAttribute)
8795
$(D ref))
8896
)
8997

98+
$(H3 $(LNAME2 initializers, Initializers))
99+
90100
$(GRAMMAR
91101
$(GNAME Initializer):
92102
$(GLINK VoidInitializer)
93103
$(GLINK NonVoidInitializer)
94104

95105
$(GNAME NonVoidInitializer):
96-
$(GLINK ExpInitializer)
106+
$(GLINK2 expression, AssignExpression)$(LEGACY_LNAME2 ExpInitializer)
97107
$(GLINK ArrayInitializer)
98108
$(GLINK StructInitializer)
99109

100-
$(GNAME ExpInitializer):
101-
$(GLINK2 expression, AssignExpression)
102-
103110
$(GNAME ArrayInitializer):
104111
$(D [) $(GLINK ArrayMemberInitializations)$(OPT) $(D ])
105112

0 commit comments

Comments
 (0)