Commit 1807d54d authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

[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/12710Reviewed-by: 's avatarKeith Randall <khr@golang.org>
parent 15dcdfba
......@@ -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)
}
......
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