summaryrefslogtreecommitdiff
path: root/src/cmd/gc/bisonerrors
diff options
context:
space:
mode:
authorTianon Gravi <admwiggin@gmail.com>2015-01-15 11:54:00 -0700
committerTianon Gravi <admwiggin@gmail.com>2015-01-15 11:54:00 -0700
commitf154da9e12608589e8d5f0508f908a0c3e88a1bb (patch)
treef8255d51e10c6f1e0ed69702200b966c9556a431 /src/cmd/gc/bisonerrors
parent8d8329ed5dfb9622c82a9fbec6fd99a580f9c9f6 (diff)
downloadgolang-upstream/1.4.tar.gz
Imported Upstream version 1.4upstream/1.4
Diffstat (limited to 'src/cmd/gc/bisonerrors')
-rwxr-xr-xsrc/cmd/gc/bisonerrors18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/cmd/gc/bisonerrors b/src/cmd/gc/bisonerrors
index 1f97fc8ce..fa74c67c3 100755
--- a/src/cmd/gc/bisonerrors
+++ b/src/cmd/gc/bisonerrors
@@ -22,6 +22,7 @@ BEGIN{
bison = 1
grammar = 0
states = 0
+ open = 0
}
# In Grammar section of y.output,
@@ -130,11 +131,26 @@ $1 == "%" {
continue
# No shift or reduce applied - found the error.
- printf("\t%s, %s,\n", state, tok);
+ printf("\t{%s, %s,\n", state, tok);
+ open = 1;
break
}
next
}
# Print other lines verbatim.
+open && /,$/ {
+ s = $0;
+ sub(",", "},", s)
+ print s
+ open = 0
+ next
+}
+
+open && /"$/ {
+ print $0 "}"
+ open = 0
+ next
+}
+
{print}