mirror of
https://github.com/golang/go
synced 2024-10-05 18:31:28 -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:
parent
15dcdfba0f
commit
1807d54d85
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user