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>"); xml_puts (out, level + 1, "<rules>");
first = false; first = false;
{ {
char const *usefulness; char const *usefulness
if (rule_useless_in_grammar_p (&rules[r])) = rule_useless_in_grammar_p (&rules[r]) ? "useless-in-grammar"
usefulness = "useless-in-grammar"; : rule_useless_in_parser_p (&rules[r]) ? "useless-in-parser"
else if (rule_useless_in_parser_p (&rules[r])) : "useful";
usefulness = "useless-in-parser";
else
usefulness = "useful";
xml_indent (out, level + 2); xml_indent (out, level + 2);
fprintf (out, "<rule number=\"%d\" usefulness=\"%s\"", fprintf (out, "<rule number=\"%d\" usefulness=\"%s\"",
rules[r].number, usefulness); rules[r].number, usefulness);

View File

@@ -19,13 +19,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h> #include <config.h>
#include "symtab.h"
#include "system.h" #include "system.h"
#include <hash.h> #include <hash.h>
#include "complain.h" #include "complain.h"
#include "gram.h" #include "gram.h"
#include "symtab.h"
/*-------------------------------------------------------------------. /*-------------------------------------------------------------------.
| Symbols sorted by tag. Allocated by the first invocation of | | Symbols sorted by tag. Allocated by the first invocation of |