1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:44:39 -07:00

ebnflint: exit with non-zero status on error

Tweak spec to avoid ebnflint complaints.

R=gri
CC=golang-dev
https://golang.org/cl/3973050
This commit is contained in:
Russ Cox 2011-01-31 17:42:10 -05:00
parent 6990bc124f
commit 614391860a
2 changed files with 5 additions and 2 deletions

View File

@ -4078,11 +4078,11 @@ SelectStmt = "select" "{" { CommClause } "}" .
CommClause = CommCase ":" { Statement ";" } .
CommCase = "case" ( SendExpr | RecvExpr) | "default" .
SendExpr = Expression "<-" Expression .
RecvExpr = [ Expression ( "=" | ":=" ) ] "<-" Expression .
</pre>
<!-- TODO(rsc):
RecvExpr = [ Expression [ "," Expression ] ( "=" | ":=" ) ] "&lt;-" Expression .
-->
RecvExpr = [ Expression ( "=" | ":=" ) ] "&lt;-" Expression .
</pre>
<p>
For all the send and receive expressions in the "select"

View File

@ -88,6 +88,7 @@ func main() {
src, err := ioutil.ReadFile(filename)
if err != nil {
scanner.PrintError(os.Stderr, err)
os.Exit(1)
}
if path.Ext(filename) == ".html" {
@ -97,9 +98,11 @@ func main() {
grammar, err := ebnf.Parse(fset, filename, src)
if err != nil {
scanner.PrintError(os.Stderr, err)
os.Exit(1)
}
if err = ebnf.Verify(fset, grammar, *start); err != nil {
scanner.PrintError(os.Stderr, err)
os.Exit(1)
}
}