Skip to content

Commit

Permalink
Add AliasDeclarationY and AutoDeclarationY to reduce duplications
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr authored and MartinNowak committed Nov 1, 2015
1 parent 5d5b1db commit 2b88b2b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions declaration.dd
Expand Up @@ -280,8 +280,11 @@ $(GNAME AutoDeclaration):
$(GLINK StorageClasses) $(I AutoDeclarationX) $(D ;)

$(GNAME AutoDeclarationX):
$(GLINK AutoDeclarationY)
$(I AutoDeclarationX) $(D ,) $(GLINK AutoDeclarationY)

$(GNAME AutoDeclarationY):
$(I Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK Initializer)
$(I AutoDeclarationX) $(D ,) $(I Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK Initializer)
)

$(P If a declaration starts with a $(I StorageClass) and has
Expand Down Expand Up @@ -326,8 +329,11 @@ $(GNAME AliasDeclaration):
$(D alias) $(I AliasDeclarationX) $(D ;)

$(GNAME AliasDeclarationX):
$(GLINK AliasDeclarationY)
$(I AliasDeclarationX) $(D ,) $(GLINK AliasDeclarationY)

$(GNAME AliasDeclarationY):
$(I Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK Type)
$(I AliasDeclarationX) $(D ,) $(I Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK Type)
)

$(P $(I AliasDeclaration)s create a symbol that is an alias for another type,
Expand Down
10 changes: 8 additions & 2 deletions grammar.dd
Expand Up @@ -1013,17 +1013,23 @@ $(GNAME AliasDeclaration):
$(D alias) $(I AliasDeclarationX) $(D ;)

$(GNAME AliasDeclarationX):
$(GLINK AliasDeclarationY)
$(I AliasDeclarationX) $(D ,) $(GLINK AliasDeclarationY)

$(GNAME AliasDeclarationY):
$(I Identifier) $(GLINK TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK Type)
$(I AliasDeclarationX) $(D ,) $(I Identifier) $(GLINK TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK Type)
)

$(GRAMMAR
$(GNAME AutoDeclaration):
$(GLINK StorageClasses) $(I AutoDeclarationX) $(D ;)

$(GNAME AutoDeclarationX):
$(GLINK AutoDeclarationY)
$(I AutoDeclarationX) $(D ,) $(GLINK AutoDeclarationY)

$(GNAME AutoDeclarationY):
$(I Identifier) $(GLINK TemplateParameters)$(OPT) $(D =) $(GLINK Initializer)
$(I AutoDeclarationX) $(D ,) $(I Identifier) $(GLINK TemplateParameters)$(OPT) $(D =) $(GLINK Initializer)
)

$(GRAMMAR
Expand Down

0 comments on commit 2b88b2b

Please sign in to comment.