Skip to content

Commit

Permalink
Fix grammar bugs around Declaration
Browse files Browse the repository at this point in the history
- `Declaration` should contain `(Aggregate|Enum|Import)Declaration`
  Otherwise we cannot use them in statement scope via `DeclarationStatement`.

- Move out `AliasThis` from `Declaration`
  It cannot appear in statement scope.

- `StorageClass` and `Attribute` should be mostly same list
  Add missing `LinkageAttribute` and `AlignAttribute` in `StorageClass`.
  Add missing `pure`, `nothrow` in the list of `Attribute`.
  Add missing `ref` in both `Attribute` and `StorageClass`.
  • Loading branch information
9rnsr committed Dec 7, 2013
1 parent bbfa1fb commit da1eccb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions grammar.dd
Expand Up @@ -1570,7 +1570,9 @@ $(H3 declaration)
$(GRAMMAR
$(GNAME Declaration):
$(GLINK AliasDeclaration)
$(GLINK AliasThis)
$(GLINK AggregateDeclaration)
$(GLINK EnumDeclaration)
$(GLINK ImportDeclaration)
$(GLINK Decl)
)

Expand Down Expand Up @@ -1641,6 +1643,8 @@ $(GNAME StorageClasses):
$(GLINK StorageClass) $(I StorageClasses)

$(GNAME StorageClass):
$(GLINK LinkageAttribute)
$(GLINK AlignAttribute)
$(D deprecated)
$(D enum)
$(D static)
Expand All @@ -1659,6 +1663,7 @@ $(GNAME StorageClass):
$(GLINK Property)
$(D pure)
$(D nothrow)
$(D ref)
)


Expand Down Expand Up @@ -2091,6 +2096,7 @@ $(GNAME Attribute):
$(GLINK Property)
$(D pure)
$(D nothrow)
$(D ref)

$(GNAME DeclarationBlock):
$(GLINK DeclDef)
Expand Down Expand Up @@ -2219,9 +2225,6 @@ $(GNAME DeclDefs):

$(GNAME DeclDef):
$(GLINK AttributeSpecifier)
$(GLINK ImportDeclaration)
$(GLINK EnumDeclaration)
$(GLINK AggregateDeclaration)
$(GLINK Declaration)
$(GLINK Constructor)
$(GLINK Destructor)
Expand All @@ -2230,6 +2233,7 @@ $(GNAME DeclDef):
$(GLINK Deallocator)
$(GLINK Invariant)
$(GLINK UnitTest)
$(GLINK AliasThis)
$(GLINK StaticConstructor)
$(GLINK StaticDestructor)
$(GLINK SharedStaticConstructor)
Expand Down

0 comments on commit da1eccb

Please sign in to comment.