summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-01-31 17:42:10 -0500
committerRuss Cox <rsc@golang.org>2011-01-31 17:42:10 -0500
commit50d4fcddc3f0a941375eff54845557db9cdf061e (patch)
tree08b1ada89ecbe070073594971ca9e6b0a4d3848b
parent63f78d183e8217b7deb8304607a8878bc7fbe807 (diff)
downloadgo-50d4fcddc3f0a941375eff54845557db9cdf061e.tar.gz
ebnflint: exit with non-zero status on error
Tweak spec to avoid ebnflint complaints. R=gri CC=golang-dev http://codereview.appspot.com/3973050
-rw-r--r--doc/go_spec.html4
-rw-r--r--src/cmd/ebnflint/ebnflint.go3
2 files changed, 5 insertions, 2 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 2d7f7768a..8707591f6 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -4078,11 +4078,11 @@ SelectStmt = "select" "{" { CommClause } "}" .
CommClause = CommCase ":" { Statement ";" } .
CommCase = "case" ( SendExpr | RecvExpr) | "default" .
SendExpr = Expression "&lt;-" Expression .
+RecvExpr = [ Expression ( "=" | ":=" ) ] "&lt;-" 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"
diff --git a/src/cmd/ebnflint/ebnflint.go b/src/cmd/ebnflint/ebnflint.go
index 10cb5b387..5eb398735 100644
--- a/src/cmd/ebnflint/ebnflint.go
+++ b/src/cmd/ebnflint/ebnflint.go
@@ -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)
}
}