Commit 904f3f5a by Richard Stallman

(main): Make sure there's some value within each pair of braces.

From-SVN: r5417
parent 7b95735e
...@@ -21,7 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -21,7 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "bi-defs.h" #include "bi-defs.h"
int int
length(n) length (n)
struct node *n; struct node *n;
{ {
int k; int k;
...@@ -32,23 +32,25 @@ length(n) ...@@ -32,23 +32,25 @@ length(n)
} }
int int
main() main ()
{ {
struct def *d; struct def *d;
struct variation *v; struct variation *v;
struct node *n; struct node *n;
yyparse(); yyparse ();
reverse(); reverse ();
for (d = defs; d; d = d->next) for (d = defs; d; d = d->next)
for (v = d->variations; v; v = v->next) for (v = d->variations; v; v = v->next)
{ {
printf("{ %d, %d, %d, {", length(v->inputs), printf ("{ %d, %d, %d, {", length (v->inputs),
length(v->outputs), length(v->literals)); length (v->outputs), length (v->literals));
for (n = v->literals; n; n = n->next) for (n = v->literals; n; n = n->next)
printf("%scode, ", n->text); printf ("%scode, ", n->text);
printf("}},\n"); if (v->literals == 0)
printf ("0");
printf ("}},\n");
} }
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment