summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-01-29 23:04:00 +0100
committerAkim Demaille <akim.demaille@gmail.com>2019-01-30 07:08:00 +0100
commit32b9dcecc75e8510c3f7beda0b060e96b31f1b1f (patch)
treea94fc956c57d238589b0cd75b749a857c49050ce /src
parentac12b725ea3d28b4e212a13e9e2f1ebf5bbe844f (diff)
downloadbison-32b9dcecc75e8510c3f7beda0b060e96b31f1b1f.tar.gz
style: sort includes and avoid assignments
* src/symtab.c: Sort includes. * src/gram.c (grammar_rules_print_xml): Avoid assignments to define 'usefulness'.
Diffstat (limited to 'src')
-rw-r--r--src/gram.c11
-rw-r--r--src/symtab.c3
2 files changed, 6 insertions, 8 deletions
diff --git a/src/gram.c b/src/gram.c
index 19c588d6..2f094944 100644
--- a/src/gram.c
+++ b/src/gram.c
@@ -218,13 +218,10 @@ grammar_rules_print_xml (FILE *out, int level)
xml_puts (out, level + 1, "<rules>");
first = false;
{
- char const *usefulness;
- if (rule_useless_in_grammar_p (&rules[r]))
- usefulness = "useless-in-grammar";
- else if (rule_useless_in_parser_p (&rules[r]))
- usefulness = "useless-in-parser";
- else
- usefulness = "useful";
+ char const *usefulness
+ = rule_useless_in_grammar_p (&rules[r]) ? "useless-in-grammar"
+ : rule_useless_in_parser_p (&rules[r]) ? "useless-in-parser"
+ : "useful";
xml_indent (out, level + 2);
fprintf (out, "<rule number=\"%d\" usefulness=\"%s\"",
rules[r].number, usefulness);
diff --git a/src/symtab.c b/src/symtab.c
index b9a934f7..0941d2b5 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -19,13 +19,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include "symtab.h"
+
#include "system.h"
#include <hash.h>
#include "complain.h"
#include "gram.h"
-#include "symtab.h"
/*-------------------------------------------------------------------.
| Symbols sorted by tag. Allocated by the first invocation of |