[Commit] nickle array.c,1.18,1.19 struct.c,1.20,1.21
Keith Packard
commit at keithp.com
Tue Jun 17 11:15:49 PDT 2003
Committed by: keithp
Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv6081
Modified Files:
array.c struct.c
Log Message:
Make array output match lexer format
Index: array.c
===================================================================
RCS file: /local/src/CVS/nickle/array.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- array.c 17 Mar 2003 20:32:56 -0000 1.18
+++ array.c 17 Jun 2003 17:15:46 -0000 1.19
@@ -96,6 +96,12 @@
if (pretty)
{
+ FilePuts (f, "(");
+ if (!TypePoly (ArrayType(a)))
+ {
+ FilePutType (f, ArrayType (a), False);
+ FilePuts (f, " ");
+ }
FilePuts (f, "[");
for (i = a->ndim - 1; i >= 0; i--)
{
@@ -103,7 +109,7 @@
if (i)
FilePuts (f, ",");
}
- FilePuts (f, "] ");
+ FilePuts (f, "]) ");
for (i = 0; i < a->ndim; i++)
FileOutput (f, '{');
}
Index: struct.c
===================================================================
RCS file: /local/src/CVS/nickle/struct.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- struct.c 11 Jun 2003 05:01:55 -0000 1.20
+++ struct.c 17 Jun 2003 17:15:46 -0000 1.21
@@ -53,8 +53,9 @@
Struct *s = &av->structs;
StructType *st = s->type;
int i;
+ Bool pretty = format == 'v' || format == 'g';
- if (format == 'v')
+ if (pretty)
FileOutput (f, '{');
for (i = 0; i < st->nelements; i++)
{
@@ -64,12 +65,12 @@
return False;
if (i < st->nelements - 1)
{
- if (format == 'v')
+ if (pretty)
FileOutput (f, ',');
FileOutput (f, ' ');
}
}
- if (format == 'v')
+ if (pretty)
FileOutput (f, '}');
return True;
}
More information about the Commit
mailing list