Commit 32b822f2 authored by Robert Griesemer's avatar Robert Griesemer

go spec: fix error in production syntax

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