summaryrefslogtreecommitdiff
path: root/src/cmd/gc/bisonerrors
diff options
context:
space:
mode:
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}