mirror of
https://github.com/golang/go
synced 2024-11-11 22:20:22 -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:
parent
6990bc124f
commit
614391860a
@ -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 ] ( "=" | ":=" ) ] "<-" Expression .
|
||||
-->
|
||||
RecvExpr = [ Expression ( "=" | ":=" ) ] "<-" 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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user