]> Cypherpunks repositories - gostls13.git/commitdiff
ebnflint: exit with non-zero status on error
authorRuss Cox <rsc@golang.org>
Mon, 31 Jan 2011 22:42:10 +0000 (17:42 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 31 Jan 2011 22:42:10 +0000 (17:42 -0500)
Tweak spec to avoid ebnflint complaints.

R=gri
CC=golang-dev
https://golang.org/cl/3973050

doc/go_spec.html
src/cmd/ebnflint/ebnflint.go

index 2d7f7768a5faae8300e13a17c716b23ef67bba78..8707591f66b77c084c05a8ec701272a8c41d34ab 100644 (file)
@@ -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"
index 10cb5b387aee6ab26b8e788b0d964ac34f4c8cfb..5eb39873544ce72c6655fe7276d777b5c882a18a 100644 (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)
        }
 }