Commit ae299f0d authored by Robert Griesemer's avatar Robert Griesemer

cosmetic change only:

- slightly simplified a couple of productions (CommClause, SwitchClause)
  by reordering

R=r
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=23304
CL=23323
parent d9abca81
...@@ -3,7 +3,7 @@ The Go Programming Language Specification (DRAFT) ...@@ -3,7 +3,7 @@ The Go Programming Language Specification (DRAFT)
Robert Griesemer, Rob Pike, Ken Thompson Robert Griesemer, Rob Pike, Ken Thompson
(January 16, 2009) (January 22, 2009)
---- ----
...@@ -2638,8 +2638,8 @@ Switch statements ...@@ -2638,8 +2638,8 @@ Switch statements
Switches provide multi-way execution. Switches provide multi-way execution.
SwitchStat = "switch" [ [ Simplestat ] ";" ] [ Expression ] "{" { CaseClause } "}" . SwitchStat = "switch" [ [ Simplestat ] ";" ] [ Expression ] "{" { CaseClause } "}" .
CaseClause = Case [ StatementList ] . CaseClause = SwitchCase ":" [ StatementList ] .
Case = ( "case" ExpressionList | "default" ) ":" . SwitchCase = "case" ExpressionList | "default" .
There can be at most one default case in a switch statement. In a case clause, There can be at most one default case in a switch statement. In a case clause,
the last statement only may be a fallthrough statement ($Fallthrough statement). the last statement only may be a fallthrough statement ($Fallthrough statement).
...@@ -2810,8 +2810,8 @@ will proceed. It looks similar to a switch statement but with the ...@@ -2810,8 +2810,8 @@ will proceed. It looks similar to a switch statement but with the
cases all referring to communication operations. cases all referring to communication operations.
SelectStat = "select" "{" { CommClause } "}" . SelectStat = "select" "{" { CommClause } "}" .
CommClause = CommCase [ StatementList ] . CommClause = CommCase ":" [ StatementList ] .
CommCase = ( "default" | ( "case" ( SendExpr | RecvExpr) ) ) ":" . CommCase = "case" ( SendExpr | RecvExpr) | "default" .
SendExpr = Expression "<-" Expression . SendExpr = Expression "<-" Expression .
RecvExpr = [ Expression ( "=" | ":=" ) ] "<-" Expression . RecvExpr = [ Expression ( "=" | ":=" ) ] "<-" Expression .
......
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