[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] maint: prepare forthcoming changes
From: |
Akim Demaille |
Subject: |
[PATCH 2/4] maint: prepare forthcoming changes |
Date: |
Fri, 29 Jun 2012 16:41:25 +0200 |
* src/gram.c (rule_rhs_print): Do not print new line anymore.
(rule_print): Make it static.
* src/closure.c, src/derives.c, src/gram.c: Adjust.
---
src/closure.c | 1 +
src/derives.c | 1 +
src/gram.c | 10 ++++++----
src/gram.h | 3 ---
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/closure.c b/src/closure.c
index 929aa77..ccd0565 100644
--- a/src/closure.c
+++ b/src/closure.c
@@ -103,6 +103,7 @@ print_fderives (void)
{
fprintf (stderr, "\t\t%3d ", r);
rule_rhs_print (&rules[r], stderr);
+ fprintf (stderr, "\n");
}
}
fprintf (stderr, "\n\n");
diff --git a/src/derives.c b/src/derives.c
index a0afbb3..8902392 100644
--- a/src/derives.c
+++ b/src/derives.c
@@ -52,6 +52,7 @@ print_derives (void)
{
fprintf (stderr, "\t\t%3d ", (*rp)->user_number);
rule_rhs_print (*rp, stderr);
+ fprintf (stderr, "\n");
}
}
diff --git a/src/gram.c b/src/gram.c
index 59e579c..5e14c60 100644
--- a/src/gram.c
+++ b/src/gram.c
@@ -105,11 +105,10 @@ rule_rhs_print (rule *r, FILE *out)
item_number *rp;
for (rp = r->rhs; *rp >= 0; rp++)
fprintf (out, " %s", symbols[*rp]->tag);
- fputc ('\n', out);
}
else
{
- fprintf (out, " /* %s */\n", _("empty"));
+ fprintf (out, " /* %s */", _("empty"));
}
}
@@ -133,7 +132,7 @@ rule_rhs_print_xml (rule *r, FILE *out, int level)
}
}
-void
+static void
rule_print (rule *r, FILE *out)
{
fprintf (out, "%s:", r->lhs->tag);
@@ -189,6 +188,7 @@ grammar_rules_partial_print (FILE *out, const char *title,
first = false;
rule_lhs_print (&rules[r], previous_lhs, out);
rule_rhs_print (&rules[r], out);
+ fprintf (out, "\n");
previous_lhs = rules[r].lhs;
}
if (!first)
@@ -296,6 +296,7 @@ grammar_dump (FILE *out, const char *title)
{
fprintf (out, "%-5d ", r);
rule_print (&rules[r], out);
+ fprintf (out, "\n");
}
}
fprintf (out, "\n\n");
@@ -313,9 +314,10 @@ grammar_rules_useless_report (const char *message)
{
complain_at (rules[r].location, w, "%s: ", message);
rule_print (&rules[r], stderr);
+ fprintf (stderr, "\n");
fflush (stderr);
}
- }
+ }
}
void
diff --git a/src/gram.h b/src/gram.h
index 75b3b0a..e502b78 100644
--- a/src/gram.h
+++ b/src/gram.h
@@ -229,9 +229,6 @@ size_t rule_rhs_length (rule *r);
/* Print this rule's RHS on OUT. */
void rule_rhs_print (rule *r, FILE *out);
-/* Print this rule on OUT. */
-void rule_print (rule *r, FILE *out);
-
--
1.7.11.1
Re: [PATCH 0/5] Warnings categories, Akim Demaille, 2012/06/29