Skip to content

Commit

Permalink
fix Issue 5841 - alias grammar is incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jan 21, 2012
1 parent f7c94aa commit 75e0330
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions declaration.dd
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@ Ddoc
$(SPEC_S Declarations,

$(GRAMMAR
$(GNAME Declaration):
$(V1 $(B typedef) $(I Decl)
) $(B alias) $(I Decl)
$(I Decl)

$(V1 $(GNAME Declaration):
$(GLINK TypedefDeclaration)
$(GLINK AliasDeclaration)
$(GLINK Decl)

$(GNAME TypedefDeclaration):
$(B typedef) $(GLINK Decl)

$(GNAME AliasDeclaration):
$(B alias) $(GLINK Decl)
)$(V2 $(GNAME Declaration):
$(GLINK AliasDeclaration)
$(GLINK AliasThisDeclaration)
$(GLINK Decl)

$(GNAME AliasDeclaration):
$(B alias) $(GLINK BasicType) $(GLINK Declarator)

$(GNAME AliasThisDeclaration):
$(B alias) $(I Identifier) $(B this)
)
$(GNAME Decl):
$(GLINK StorageClasses) $(I Decl)
$(GLINK BasicType) $(GLINK Declarators) $(B ;)
Expand Down Expand Up @@ -368,9 +384,8 @@ myint m; // initialized to 7
<h3><a name="alias">Type Aliasing</a></h3>

$(P
It's sometimes convenient to use an alias for a type, such as a shorthand for typing
out a long, complex type like a pointer to a function. In D, this is done with the
alias declaration:
$(GLINK AliasDeclaration)s create a symbol that is an alias for another type,
and can be used anywhere that other type may appear.
)

--------------------
Expand Down

0 comments on commit 75e0330

Please sign in to comment.