<p>
If the dividend is positive and the divisor is a constant power of 2,
-the division may be replaced by a left shift, and computing the remainder may
+the division may be replaced by a right shift, and computing the remainder may
be replaced by a bitwise "and" operation:
</p>
<pre class="ebnf">
Statement =
- Declaration | EmptyStmt | LabeledStmt |
- SimpleStmt | GoStmt | ReturnStmt | BreakStmt | ContinueStmt | GotoStmt |
+ Declaration | LabeledStmt | SimpleStmt |
+ GoStmt | ReturnStmt | BreakStmt | ContinueStmt | GotoStmt |
FallthroughStmt | Block | IfStmt | SwitchStmt | SelectStmt | ForStmt |
DeferStmt .
-SimpleStmt = ExpressionStmt | IncDecStmt | Assignment | ShortVarDecl .
+SimpleStmt = EmptyStmt | ExpressionStmt | IncDecStmt | Assignment | ShortVarDecl .
StatementList = Statement { Separator Statement } .
Separator = [ ";" ] .
</p>
<pre class="ebnf">
-IfStmt = "if" [ [ SimpleStmt ] ";" ] [ Expression ] Block [ "else" Statement ] .
+IfStmt = "if" [ SimpleStmt ";" ] [ Expression ] Block [ "else" Statement ] .
</pre>
<pre>
</p>
<pre class="ebnf">
-ExprSwitchStmt = "switch" [ [ SimpleStmt ] ";" ] [ Expression ] "{" { ExprCaseClause } "}" .
+ExprSwitchStmt = "switch" [ SimpleStmt ";" ] [ Expression ] "{" { ExprCaseClause } "}" .
ExprCaseClause = ExprSwitchCase ":" [ StatementList ] .
ExprSwitchCase = "case" ExpressionList | "default" .
</pre>
</p>
<pre class="ebnf">
-TypeSwitchStmt = "switch" [ [ SimpleStmt ] ";" ] TypeSwitchGuard "{" { TypeCaseClause } "}" .
+TypeSwitchStmt = "switch" [ SimpleStmt ";" ] TypeSwitchGuard "{" { TypeCaseClause } "}" .
TypeSwitchGuard = [ identifier ":=" ] Expression "." "(" "type" ")" .
TypeCaseClause = TypeSwitchCase ":" [ StatementList ] .
TypeSwitchCase = "case" Type | "default" .
</p>
<pre class="ebnf">
-ForClause = [ InitStmt ] ";" [ Condition ] ";" [ PostStmt ] .
+ForClause = InitStmt ";" [ Condition ] ";" PostStmt .
InitStmt = SimpleStmt .
PostStmt = SimpleStmt .
</pre>