]> Cypherpunks repositories - gostls13.git/commitdiff
go spec: fix error in production syntax
authorRobert Griesemer <gri@golang.org>
Fri, 13 May 2011 19:54:51 +0000 (12:54 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 13 May 2011 19:54:51 +0000 (12:54 -0700)
Fix analoguous error in ebnf.go which already
correctly accepted an empty production.

Fixes #1821.

R=r
CC=golang-dev
https://golang.org/cl/4526056

doc/go_spec.html
src/pkg/ebnf/ebnf.go

index 8e2f0cddf52fa04e0fc1605c718b46df028632ea..11a31cb0c70a3e6b429f6ed3b0d4ffb7d7f8f1be 100644 (file)
@@ -1,5 +1,5 @@
 <!-- title The Go Programming Language Specification -->
-<!-- subtitle Version of May 12, 2011 -->
+<!-- subtitle Version of May 13, 2011 -->
 
 <!--
 TODO
@@ -46,7 +46,7 @@ The syntax is specified using Extended Backus-Naur Form (EBNF):
 </p>
 
 <pre class="grammar">
-Production  = production_name "=" Expression "." .
+Production  = production_name "=" [ Expression ] "." .
 Expression  = Alternative { "|" Alternative } .
 Alternative = Term { Term } .
 Term        = production_name | token [ "..." token ] | Group | Option | Repetition .
index 7918c4593bbaa1203b3a90086078301f9dbe9962..964e1c1b0e6cc0964667996541ed51a3305c3736 100644 (file)
@@ -5,7 +5,7 @@
 // Package ebnf is a library for EBNF grammars. The input is text ([]byte)
 // satisfying the following grammar (represented itself in EBNF):
 //
-//     Production  = name "=" Expression "." .
+//     Production  = name "=" [ Expression ] "." .
 //     Expression  = Alternative { "|" Alternative } .
 //     Alternative = Term { Term } .
 //     Term        = name | token [ "..." token ] | Group | Option | Repetition .