Skip to content

Grammar spec should not use "opt" #3857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dlang.org.ddoc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ NOTICE_L=<a href="$1" class="notice">$2</a>
NOTICE=<span class="notice">$1</span>
_=

OPT=$(SUBSCRIPT opt)
OPT=<abbr title="This grammar entity is optional">?</abbr>
_=

PAGE_TOOLS=
Expand Down
9 changes: 6 additions & 3 deletions spec/expression.dd
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,8 @@ $(H3 $(LEGACY_LNAME2 slice_operations, slice_expressions, Slice Operations))
$(GRAMMAR
$(GNAME SliceOperation):
$(D [ ])
$(D [) $(GLINK Slice) $(D ,)$(OPT) $(D ])
$(D [) $(GLINK Slice) $(D ])
$(D [) $(GLINK Slice) $(D ,) $(D ])

$(GNAME Slice):
$(GLINK AssignExpression)
Expand Down Expand Up @@ -2612,8 +2613,10 @@ $(GNAME AssertExpression):
$(D assert $(LPAREN)) $(GLINK AssertArguments) $(D $(RPAREN))

$(GNAME AssertArguments):
$(GLINK AssignExpression) $(D ,)$(OPT)
$(GLINK AssignExpression) $(D ,) $(GLINK AssignExpression) $(D ,)$(OPT)
$(GLINK AssignExpression)
$(GLINK AssignExpression) $(D ,)
$(GLINK AssignExpression) $(D ,) $(GLINK AssignExpression)
$(GLINK AssignExpression) $(D ,) $(GLINK AssignExpression) $(D ,)
)

$(P The first $(I AssignExpression) is evaluated and
Expand Down
6 changes: 4 additions & 2 deletions spec/function.dd
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ $(GNAME FunctionBody):
$(GLINK MissingFunctionBody)

$(GNAME SpecifiedFunctionBody):
$(D do)$(OPT) $(GLINK2 statement, BlockStatement)
$(GLINK FunctionContracts)$(OPT) $(GLINK InOutContractExpression) $(D do)$(OPT) $(GLINK2 statement, BlockStatement)
$(GLINK2 statement, BlockStatement)
$(D do) $(GLINK2 statement, BlockStatement)
$(GLINK FunctionContracts)$(OPT) $(GLINK InOutContractExpression) $(GLINK2 statement, BlockStatement)
$(GLINK FunctionContracts)$(OPT) $(GLINK InOutContractExpression) $(D do) $(GLINK2 statement, BlockStatement)
$(GLINK FunctionContracts)$(OPT) $(GLINK InOutStatement) $(D do) $(GLINK2 statement, BlockStatement)

$(GNAME ShortenedFunctionBody):
Expand Down