1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

[dev.ssa] cmd/compile: detect unbalanced rules

Rules may span multiple lines,
but if we're still unbalanced at the
end of the file, something is wrong.

I write unbalanced rules depressingly often.

Change-Id: Ibd04aa06539e2a0ffef73bb665febf3542fd11f1
Reviewed-on: https://go-review.googlesource.com/12710
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2015-07-27 12:45:56 -07:00
parent 15dcdfba0f
commit 1807d54d85

View File

@ -88,6 +88,9 @@ func genRules(arch arch) {
}
rule = ""
}
if unbalanced(rule) {
log.Fatalf("unbalanced rule: %v\n", rule)
}
if err := scanner.Err(); err != nil {
log.Fatalf("scanner failed: %v\n", err)
}