From f3a33bca40cb376f7a3b8a307782c5dbbd6a0975 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 14 Sep 2009 17:39:17 -0700 Subject: [PATCH] make SimpleStmt include EmptyStmt and the grammar simplifies a bit. 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 --- doc/go_spec.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index c883de49c0..d602168c67 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -2557,7 +2557,7 @@ Examples:

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:

@@ -3011,12 +3011,12 @@ Statements control execution.
 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     = [ ";" ] .
@@ -3196,7 +3196,7 @@ is equivalent to true.
 

-IfStmt    = "if" [ [ SimpleStmt ] ";" ] [ Expression ] Block [ "else" Statement ] .
+IfStmt    = "if" [ SimpleStmt ";" ] [ Expression ] Block [ "else" Statement ] .
 
@@ -3261,7 +3261,7 @@ the expression true.
 

-ExprSwitchStmt = "switch" [ [ SimpleStmt ] ";" ] [ Expression ] "{" { ExprCaseClause } "}" .
+ExprSwitchStmt = "switch" [ SimpleStmt ";" ] [ Expression ] "{" { ExprCaseClause } "}" .
 ExprCaseClause = ExprSwitchCase ":" [ StatementList ] .
 ExprSwitchCase = "case" ExpressionList | "default" .
 
@@ -3311,7 +3311,7 @@ in the type assertion.

-TypeSwitchStmt  = "switch" [ [ SimpleStmt ] ";" ] TypeSwitchGuard "{" { TypeCaseClause } "}" .
+TypeSwitchStmt  = "switch" [ SimpleStmt ";" ] TypeSwitchGuard "{" { TypeCaseClause } "}" .
 TypeSwitchGuard = [ identifier ":=" ] Expression "." "(" "type" ")" .
 TypeCaseClause  = TypeSwitchCase ":" [ StatementList ] .
 TypeSwitchCase  = "case" Type | "default" .
@@ -3426,7 +3426,7 @@ an increment or decrement statement. The init statement may be a
 

-ForClause = [ InitStmt ] ";" [ Condition ] ";" [ PostStmt ] .
+ForClause = InitStmt ";" [ Condition ] ";" PostStmt .
 InitStmt = SimpleStmt .
 PostStmt = SimpleStmt .
 
-- 2.48.1