Skip to content

Commit d4e013b

Browse files
committed
BasicTypePrimaryType
1 parent 6ce897d commit d4e013b

File tree

7 files changed

+35
-48
lines changed

7 files changed

+35
-48
lines changed

spec/class.dd

+7-16
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,12 @@ $(GNAME ClassDeclaration):
3232
$(GLINK2 template, ClassTemplateDeclaration)
3333

3434
$(GNAME BaseClassList):
35-
$(D :) $(GLINK SuperClassOrInterface)
36-
$(D :) $(GLINK SuperClassOrInterface) $(D ,) $(GLINK Interfaces)
35+
$(D :) $(GLINK BasicType)
36+
$(D :) $(GLINK BasicType) $(D ,) $(GLINK BasicTypes)
3737

38-
$(GNAME SuperClassOrInterface):
39-
$(GLINK2 type, BasicType)
40-
41-
$(GNAME Interfaces):
42-
$(GLINK Interface)
43-
$(GLINK Interface) $(D ,) $(GSELF Interfaces)
44-
45-
$(GNAME Interface):
46-
$(GLINK2 type, BasicType)
38+
$(GNAME BasicTypes):
39+
$(GLINK BasicType)
40+
$(GLINK BasicType) $(D ,) $(GSELF BasicTypes)
4741
)
4842

4943
$(P A class consists of:)
@@ -1439,20 +1433,17 @@ $(H3 $(LNAME2 anonymous, Anonymous Nested Classes))
14391433

14401434
$(GRAMMAR
14411435
$(GNAME NewAnonClassExpression):
1442-
$(D new) $(D class) $(GLINK ConstructorArgs)$(OPT) $(GLINK AnonBaseClassList)$(OPT) $(GLINK2 struct, AggregateBody)
1436+
$(D new) $(D class) $(GLINK ConstructorArgs)$(OPT) $(GLINK BasicTypes)$(OPT) $(GLINK2 struct, AggregateBody)
14431437

14441438
$(GNAME ConstructorArgs):
14451439
$(D $(LPAREN)) $(GLINK2 expression, NamedArgumentList)$(OPT) $(D $(RPAREN))
14461440

1447-
$(GNAME AnonBaseClassList):
1448-
$(GLINK SuperClassOrInterface)
1449-
$(GLINK SuperClassOrInterface) $(D ,) $(GLINK Interfaces)
14501441
)
14511442

14521443
which is equivalent to:
14531444

14541445
$(INFORMATIVE_GRAMMAR
1455-
$(D class) $(GLINK_LEX Identifier) $(D :) $(I AnonBaseClassList) $(I AggregateBody)
1446+
$(D class) $(GLINK_LEX Identifier) $(D :) $(I BasicTypes) $(I AggregateBody)
14561447
// ...
14571448
$(D new) $(I Identifier) $(I ConstructorArgs)
14581449
)

spec/declaration.dd

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $(H3 $(LNAME2 variable-declarations, Variable Declarations))
4141

4242
$(GRAMMAR
4343
$(GNAME VarDeclarations):
44-
$(GLINK StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK2 type, TypeSuffixes)$(OPT) $(GLINK IdentifierInitializers) $(D ;)
44+
$(GLINK StorageClasses)$(OPT) $(GLINK2 type, PrimaryType) $(GLINK2 type, TypeSuffixes)$(OPT) $(GLINK IdentifierInitializers) $(D ;)
4545
$(GLINK AutoDeclaration)
4646

4747
$(GNAME IdentifierInitializers): $(LEGACY_LNAME2 Declarators, DeclaratorIdentifierList)
@@ -334,8 +334,8 @@ $(H2 $(LNAME2 alias, Alias Declarations))
334334

335335
$(GRAMMAR
336336
$(GNAME AliasDeclaration):
337-
$(D alias) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK2 type, TypeSuffixes)$(OPT) $(GLINK Identifiers) $(D ;)
338-
$(D alias) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK2 function, FuncDeclarator) $(D ;)
337+
$(D alias) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, PrimaryType) $(GLINK2 type, TypeSuffixes)$(OPT) $(GLINK Identifiers) $(D ;)
338+
$(D alias) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, PrimaryType) $(GLINK2 function, FuncDeclarator) $(D ;)
339339
$(D alias) $(GLINK AliasAssignments) $(D ;)
340340

341341
$(GNAME Identifiers):
@@ -397,8 +397,8 @@ void foo(myint m) { ... } // error, multiply defined function foo
397397
alias abc = foo.bar; // is it a type or a symbol?
398398
--------------------
399399

400-
$(BEST_PRACTICE Other than when aliasing simple basic type names,
401-
type alias names should be Capitalized.)
400+
$(BEST_PRACTICE Other than when aliasing simple fundamental type names,
401+
type alias names should be capitalized.)
402402

403403
$(H3 $(LNAME2 alias-symbol, Symbol Aliases))
404404

@@ -690,7 +690,7 @@ $(GRAMMAR
690690
$(GNAME AliasReassignment):
691691
$(GLINK_LEX Identifier) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, Type)
692692
$(GLINK_LEX Identifier) $(D =) $(GLINK2 expression, FunctionLiteral)
693-
$(GLINK_LEX Identifier) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK2 function, Parameters) $(GLINK2 function, MemberFunctionAttributes)$(OPT)
693+
$(GLINK_LEX Identifier) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, PrimaryType) $(GLINK2 function, Parameters) $(GLINK2 function, MemberFunctionAttributes)$(OPT)
694694
)
695695

696696
$(P An alias declaration inside a template can be reassigned a new value.)

spec/expression.dd

+5-5
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ $(GNAME PostfixExpression):
17081708
$(GSELF PostfixExpression) $(D ++)
17091709
$(GSELF PostfixExpression) $(D --)
17101710
$(GSELF PostfixExpression) $(D $(LPAREN)) $(GLINK NamedArgumentList)$(OPT) $(D $(RPAREN))
1711-
$(GLINK2 type, TypeCtors)$(OPT) $(GLINK2 type, BasicType) $(D $(LPAREN)) $(GLINK NamedArgumentList)$(OPT) $(D $(RPAREN))
1711+
$(GLINK2 type, TypeCtors)$(OPT) $(GLINK2 type, PrimaryType) $(D $(LPAREN)) $(GLINK NamedArgumentList)$(OPT) $(D $(RPAREN))
17121712
$(GSELF PostfixExpression) $(GLINK IndexOperation)
17131713
$(GSELF PostfixExpression) $(GLINK SliceOperation)
17141714
)
@@ -2393,14 +2393,14 @@ $(H3 $(LNAME2 function_literals, Function Literals))
23932393

23942394
$(GRAMMAR
23952395
$(GNAME FunctionLiteral):
2396-
$(D function) $(GLINK RefOrAutoRef)$(OPT) $(GLINK BasicTypeWithSuffixes)$(OPT) $(GLINK ParameterWithAttributes)$(OPT) $(GLINK FunctionLiteralBody)
2397-
$(D delegate) $(GLINK RefOrAutoRef)$(OPT) $(GLINK BasicTypeWithSuffixes)$(OPT) $(GLINK ParameterWithMemberAttributes)$(OPT) $(GLINK FunctionLiteralBody)
2396+
$(D function) $(GLINK RefOrAutoRef)$(OPT) $(GLINK PrimaryTypeWithSuffixes)$(OPT) $(GLINK ParameterWithAttributes)$(OPT) $(GLINK FunctionLiteralBody)
2397+
$(D delegate) $(GLINK RefOrAutoRef)$(OPT) $(GLINK PrimaryTypeWithSuffixes)$(OPT) $(GLINK ParameterWithMemberAttributes)$(OPT) $(GLINK FunctionLiteralBody)
23982398
$(GLINK RefOrAutoRef)$(OPT) $(GLINK ParameterWithMemberAttributes) $(GLINK FunctionLiteralBody)
23992399
$(GLINK2 statement, BlockStatement)
24002400
$(IDENTIFIER) $(D =>) $(GLINK AssignExpression)
24012401

2402-
$(GNAME BasicTypeWithSuffixes):
2403-
$(GLINK2 type, BasicType) $(GLINK2 type, TypeSuffixes)$(OPT)
2402+
$(GNAME PrimaryTypeWithSuffixes):
2403+
$(GLINK2 type, PrimaryType) $(GLINK2 type, TypeSuffixes)$(OPT)
24042404

24052405
$(GNAME ParameterWithAttributes):
24062406
$(GLINK2 function, Parameters) $(GLINK2 function, FunctionAttributes)$(OPT)

spec/function.dd

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ $(H2 $(LNAME2 grammar, Function Declarations))
88

99
$(GRAMMAR
1010
$(GNAME FuncDeclaration):
11-
$(GLINK2 declaration, StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK FuncDeclarator) $(GLINK FunctionBody)
12-
$(GLINK2 declaration, StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK FuncDeclarator) $(GLINK MissingFunctionBody)
11+
$(GLINK2 declaration, StorageClasses)$(OPT) $(GLINK2 type, PrimaryType) $(GLINK FuncDeclarator) $(GLINK FunctionBody)
12+
$(GLINK2 declaration, StorageClasses)$(OPT) $(GLINK2 type, PrimaryType) $(GLINK FuncDeclarator) $(GLINK MissingFunctionBody)
1313
$(GLINK AutoFuncDeclaration)
1414

1515
$(GNAME AutoFuncDeclaration):
@@ -49,7 +49,7 @@ $(GNAME Parameter):
4949
$(GLINK ParameterDeclaration) $(D =) $(ASSIGNEXPRESSION) $(D ...)
5050

5151
$(GNAME ParameterDeclaration):
52-
$(GLINK ParameterAttributes)$(OPT) $(GLINK2 type, BasicType) $(GLINK2 declaration, Declarator)
52+
$(GLINK ParameterAttributes)$(OPT) $(GLINK2 type, PrimaryType) $(GLINK2 declaration, Declarator)
5353
$(GLINK ParameterAttributes)$(OPT) $(GLINK2 type, Type)
5454

5555
$(GNAME ParameterAttributes):

spec/simd.dd

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ $(HEADERNAV_TOC)
99
Vector types are a fixed array of floating or integer types, and
1010
vector operations operate simultaneously on them.)
1111

12-
$(P Specialized $(GLINK2 type, Vector) types provide access to them.)
12+
$(P Specialized $(D __vector$(LPAREN))$(GLINK2 type, Type)$(D $(RPAREN)) types provide access to them.)
1313

14-
$(P The $(GLINK2 type, VectorBaseType) must be a $(DDSUBLINK spec/arrays, static-arrays, Static Array).
15-
The $(GNAME VectorElementType) is the unqualified element type of the
14+
$(P The type argument to $(D __vector) must be a $(DDSUBLINK spec/arrays, static-arrays, Static Array).
15+
The element type is the unqualified element type of the
1616
static array.
1717
The dimension of the static array is the number
1818
of elements in the vector.
@@ -28,7 +28,7 @@ $(HEADERNAV_TOC)
2828
algorithm than relying on emulation.)
2929

3030
$(BEST_PRACTICE Use the declarations in $(CORE_SIMD) instead of
31-
the language $(GLINK2 type, Vector) grammar.
31+
the language $(D __vector) keyword.
3232
)
3333

3434
$(H2 $(LNAME2 core_simd, $(D core.simd)))
@@ -98,7 +98,7 @@ $(H3 $(LNAME2 conversions, Conversions))
9898
$(P Vector types of the same size (number_of_elements * size_of_element)
9999
can be implicitly converted among
100100
each other, this is done as a reinterpret cast (a type paint).
101-
Vector types can be cast to their $(GLINK2 type, VectorBaseType).)
101+
Vector types can be cast to their underyling array type.)
102102

103103
$(P Integers and floating point values can be implicitly converted
104104
to their vector equivalents:)

spec/template.dd

+2-3
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ $(H3 $(LNAME2 template_value_parameter, Value Parameters))
508508

509509
$(GRAMMAR
510510
$(GNAME TemplateValueParameter):
511-
$(GLINK2 type, BasicType) $(GLINK2 declaration, Declarator) $(GLINK TemplateValueParameterSpecialization)$(OPT) $(GLINK TemplateValueParameterDefault)$(OPT)
511+
$(GLINK2 type, Type) $(GLINK_LEX, Identifier) $(GLINK TemplateValueParameterSpecialization)$(OPT) $(GLINK TemplateValueParameterDefault)$(OPT)
512512

513513
$(GNAME TemplateValueParameterSpecialization):
514514
$(D :) $(GLINK2 expression, ConditionalExpression)
@@ -573,8 +573,7 @@ $(H3 $(LNAME2 aliasparameters, Alias Parameters))
573573

574574
$(GRAMMAR
575575
$(GNAME TemplateAliasParameter):
576-
$(D alias) $(GLINK_LEX Identifier) $(GLINK TemplateAliasParameterSpecialization)$(OPT) $(GLINK TemplateAliasParameterDefault)$(OPT)
577-
$(D alias) $(GLINK2 type, BasicType) $(GLINK2 declaration, Declarator) $(GLINK TemplateAliasParameterSpecialization)$(OPT) $(GLINK TemplateAliasParameterDefault)$(OPT)
576+
$(D alias) $(GLINK2 type, Type)$(OPT) $(GLINK_LEX Identifier) $(GLINK TemplateAliasParameterSpecialization)$(OPT) $(GLINK TemplateAliasParameterDefault)$(OPT)
578577

579578
$(GNAME TemplateAliasParameterSpecialization):
580579
$(D :) $(GLINK2 type, Type)

spec/type.dd

+7-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $(H2 $(LNAME2 grammar, Grammar))
1212

1313
$(GRAMMAR
1414
$(GNAME Type):
15-
$(GLINK TypeCtors)$(OPT) $(GLINK BasicType) $(GLINK TypeSuffixes)$(OPT)
15+
$(GLINK TypeCtors)$(OPT) $(GLINK PrimaryType) $(GLINK TypeSuffixes)$(OPT)
1616

1717
$(GNAME TypeCtors):
1818
$(GLINK TypeCtor)
@@ -24,23 +24,20 @@ $(GNAME TypeCtor):
2424
$(D inout)
2525
$(D shared)
2626

27+
$(GNAME PrimaryType):
28+
$(GLINK BasicType)
29+
$(D __vector) $(D $(LPAREN)) $(GLINK Type) $(D $(RPAREN))
30+
$(GLINK TypeCtor) $(D $(LPAREN)) $(GLINK Type) $(D $(RPAREN))
31+
2732
$(GNAME BasicType):
2833
$(GLINK FundamentalType)
2934
$(D .) $(GLINK QualifiedIdentifier)
3035
$(GLINK QualifiedIdentifier)
3136
$(GLINK Typeof)
3237
$(GLINK Typeof) $(D .) $(GLINK QualifiedIdentifier)
33-
$(GLINK TypeCtor) $(D $(LPAREN)) $(GLINK Type) $(D $(RPAREN))
34-
$(GLINK Vector)
3538
$(GLINK2 traits, TraitsExpression)
3639
$(GLINK MixinType)
3740

38-
$(GNAME Vector):
39-
$(D __vector) $(D $(LPAREN)) $(GLINK VectorBaseType) $(D $(RPAREN))
40-
41-
$(GNAME VectorBaseType):
42-
$(GLINK Type)
43-
4441
$(GNAME FundamentalType):
4542
$(MULTICOLS 5,
4643
$(D bool)
@@ -836,7 +833,7 @@ $(H3 $(LNAME2 size_t, $(D size_t)))
836833
all addressable memory.)
837834

838835
$(H3 $(LNAME2 ptrdiff_t, $(D ptrdiff_t)))
839-
$(P $(D ptrdiff_t) is an alias to the signed integral basic type the same size as $(D size_t).)
836+
$(P $(D ptrdiff_t) is an alias to the signed integral type the same size as $(D size_t).)
840837

841838
$(H3 $(LNAME2 string, $(D string)))
842839

0 commit comments

Comments
 (0)