Skip to content

Commit

Permalink
make SimpleStmt include EmptyStmt and the grammar simplifies a bit.
Browse files Browse the repository at this point in the history
SimpleStmt was always used as an option.

fix bug: divide is a right shift

DELTA=8  (0 added, 0 deleted, 8 changed)
OCL=34612
CL=34614
  • Loading branch information
robpike committed Sep 15, 2009
1 parent 28eba48 commit f3a33bc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions doc/go_spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,7 @@ <h3 id="Arithmetic_operators">Arithmetic operators</h3>

<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>

Expand Down Expand Up @@ -3011,12 +3011,12 @@ <h2 id="Statements">Statements</h2>

<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 = [ ";" ] .
Expand Down Expand Up @@ -3196,7 +3196,7 @@ <h3 id="If_statements">If statements</h3>
</p>

<pre class="ebnf">
IfStmt = "if" [ [ SimpleStmt ] ";" ] [ Expression ] Block [ "else" Statement ] .
IfStmt = "if" [ SimpleStmt ";" ] [ Expression ] Block [ "else" Statement ] .
</pre>

<pre>
Expand Down Expand Up @@ -3261,7 +3261,7 @@ <h4 id="Expression_switches">Expression switches</h4>
</p>

<pre class="ebnf">
ExprSwitchStmt = "switch" [ [ SimpleStmt ] ";" ] [ Expression ] "{" { ExprCaseClause } "}" .
ExprSwitchStmt = "switch" [ SimpleStmt ";" ] [ Expression ] "{" { ExprCaseClause } "}" .
ExprCaseClause = ExprSwitchCase ":" [ StatementList ] .
ExprSwitchCase = "case" ExpressionList | "default" .
</pre>
Expand Down Expand Up @@ -3311,7 +3311,7 @@ <h4 id="Type_switches">Type switches</h4>
</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" .
Expand Down Expand Up @@ -3426,7 +3426,7 @@ <h3 id="For_statements">For statements</h3>
</p>

<pre class="ebnf">
ForClause = [ InitStmt ] ";" [ Condition ] ";" [ PostStmt ] .
ForClause = InitStmt ";" [ Condition ] ";" PostStmt .
InitStmt = SimpleStmt .
PostStmt = SimpleStmt .
</pre>
Expand Down

0 comments on commit f3a33bc

Please sign in to comment.