mirror of
https://github.com/golang/go
synced 2024-11-22 00:14:42 -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 ";" } .
|
CommClause = CommCase ":" { Statement ";" } .
|
||||||
CommCase = "case" ( SendExpr | RecvExpr) | "default" .
|
CommCase = "case" ( SendExpr | RecvExpr) | "default" .
|
||||||
SendExpr = Expression "<-" Expression .
|
SendExpr = Expression "<-" Expression .
|
||||||
|
RecvExpr = [ Expression ( "=" | ":=" ) ] "<-" Expression .
|
||||||
|
</pre>
|
||||||
<!-- TODO(rsc):
|
<!-- TODO(rsc):
|
||||||
RecvExpr = [ Expression [ "," Expression ] ( "=" | ":=" ) ] "<-" Expression .
|
RecvExpr = [ Expression [ "," Expression ] ( "=" | ":=" ) ] "<-" Expression .
|
||||||
-->
|
-->
|
||||||
RecvExpr = [ Expression ( "=" | ":=" ) ] "<-" Expression .
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For all the send and receive expressions in the "select"
|
For all the send and receive expressions in the "select"
|
||||||
|
@ -88,6 +88,7 @@ func main() {
|
|||||||
src, err := ioutil.ReadFile(filename)
|
src, err := ioutil.ReadFile(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
scanner.PrintError(os.Stderr, err)
|
scanner.PrintError(os.Stderr, err)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if path.Ext(filename) == ".html" {
|
if path.Ext(filename) == ".html" {
|
||||||
@ -97,9 +98,11 @@ func main() {
|
|||||||
grammar, err := ebnf.Parse(fset, filename, src)
|
grammar, err := ebnf.Parse(fset, filename, src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
scanner.PrintError(os.Stderr, err)
|
scanner.PrintError(os.Stderr, err)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = ebnf.Verify(fset, grammar, *start); err != nil {
|
if err = ebnf.Verify(fset, grammar, *start); err != nil {
|
||||||
scanner.PrintError(os.Stderr, err)
|
scanner.PrintError(os.Stderr, err)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user