Commit 61439186 authored by Russ Cox's avatar Russ Cox

ebnflint: exit with non-zero status on error

Tweak spec to avoid ebnflint complaints.

R=gri
CC=golang-dev
https://golang.org/cl/3973050
parent 6990bc12
......@@ -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"
......
......@@ -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)
}
}
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