Skip to content

Commit 09c2699

Browse files
CyberShadowGeod24
authored andcommitted
spec: Add EmptyDeclaration and EmptyStatement
- Semantically indicate that the various occurrences of $(D ;) all mean the same thing - Add explicit counterpart to e.g. NonEmptyStatement - Avoiding mixing leaf and non-leaf nodes makes the grammar more structured in general.
1 parent 8eb4c9c commit 09c2699

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

spec/module.dd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ $(GNAME DeclDef):
3737
$(GLINK2 template-mixin, TemplateMixinDeclaration)
3838
$(GLINK2 template-mixin, TemplateMixin)
3939
$(GLINK MixinDeclaration)
40+
$(GLINK EmptyDeclaration)
41+
42+
$(GNAME EmptyDeclaration):
4043
$(D ;)
4144
)
4245

spec/statement.dd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ $(HEADERNAV_TOC)
1212

1313
$(GRAMMAR
1414
$(GNAME Statement):
15-
$(D ;)
15+
$(GLINK EmptyStatement)
1616
$(GLINK NonEmptyStatement)
1717
$(GLINK ScopeBlockStatement)
1818

19+
$(GNAME EmptyStatement):
20+
$(D ;)
21+
1922
$(GNAME NoScopeNonEmptyStatement):
2023
$(GLINK NonEmptyStatement)
2124
$(GLINK BlockStatement)
2225

2326
$(GNAME NoScopeStatement):
24-
$(D ;)
27+
$(GLINK EmptyStatement)
2528
$(GLINK NonEmptyStatement)
2629
$(GLINK BlockStatement)
2730

@@ -1095,7 +1098,7 @@ $(GNAME StatementListNoCaseNoDefault):
10951098
$(GLINK StatementNoCaseNoDefault) $(GSELF StatementListNoCaseNoDefault)
10961099

10971100
$(GNAME StatementNoCaseNoDefault):
1098-
$(D ;)
1101+
$(GLINK EmptyStatement)
10991102
$(GLINK NonEmptyStatementNoCaseNoDefault)
11001103
$(GLINK ScopeBlockStatement)
11011104
)

0 commit comments

Comments
 (0)