style: sort includes and avoid assignments

* src/symtab.c: Sort includes.
* src/gram.c (grammar_rules_print_xml): Avoid assignments to define
'usefulness'.
This commit is contained in:
Akim Demaille
2019-01-29 23:04:00 +01:00
parent ac12b725ea
commit 32b9dcecc7
2 changed files with 6 additions and 8 deletions

View File

@@ -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);

View File

@@ -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 |