1
0
mirror of https://github.com/golang/go synced 2024-11-25 05:57:57 -07:00

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
This commit is contained in:
Robert Griesemer 2011-05-13 12:54:51 -07:00
parent 5236814edd
commit 32b822f29a
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<!-- 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):
</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 .

View File

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