Commit 7271e048 authored by Robert Griesemer's avatar Robert Griesemer

- added missing case for opt. semicolons (labels)

- more precise wording by having an explicit list of cases
- simplified statement list

R=r
DELTA=16  (10 added, 0 deleted, 6 changed)
OCL=16871
CL=16875
parent 8f5b277c
...@@ -59,6 +59,9 @@ Open issues according to gri: ...@@ -59,6 +59,9 @@ Open issues according to gri:
variables and the use of '&' to convert methods into function pointers. variables and the use of '&' to convert methods into function pointers.
[ ] Conversions: can we say: "type T int; T(3.0)" ? [ ] Conversions: can we say: "type T int; T(3.0)" ?
[ ] Is . import implemented? [ ] Is . import implemented?
[ ] Do we allow empty statements? If so, do we allow empty statements after a label?
and if so, does a label followed by an empty statement (a semicolon) still denote
a for loop that is following, and can break L be used inside it?
Decisions in need of integration into the doc: Decisions in need of integration into the doc:
...@@ -1980,14 +1983,21 @@ Statements control execution. ...@@ -1980,14 +1983,21 @@ Statements control execution.
SimpleStat = SimpleStat =
ExpressionStat | IncDecStat | Assignment | SimpleVarDecl . ExpressionStat | IncDecStat | Assignment | SimpleVarDecl .
Statements in a statement list are separated by semicolons, which can be Statements in a statement list are separated by semicolons, which can be
omitted in some cases as expressed by the OptSemicolon production. omitted in some cases as expressed by the OptSemicolon production.
They are optional immediately after a closing parenthesis ")" terminating a
list of declarations, or a closing brace terminating a type declaration or
a block. Specifically, they cannot be omitted after the closing brace of a
composite literal.
StatementList = Statement { OptSemicolon Statement } [ ";" ] . StatementList = Statement { OptSemicolon Statement } .
A semicolon may be omitted immediately following:
- a closing parenthesis ")" ending a list of declarations (§Declarations and scope rules)
- a closing brace "}" ending a type declaration (§Type declarations)
- a closing brace "}" ending a block (including switch and select statements)
- a label declaration (§Label declarations)
In all other cases a semicolon is required to separate two statements. Since there
is an empty statement, a statement list can always be ``terminated'' with a semicolon.
Label declarations Label declarations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment