[Commit] nickle ChangeLog, 1.23, 1.24 array.c, 1.22, 1.23 builtin-toplevel.c, 1.20, 1.21 builtin.c, 1.16, 1.17 compile.c, 1.146, 1.147 execute.c, 1.87, 1.88 file.c, 1.59, 1.60 gram.y, 1.128, 1.129 hash.c, 1.4, 1.5 lex.l, 1.70, 1.71 main.c, 1.35, 1.36 nickle.h, 1.113, 1.114 pretty.c, 1.65, 1.66 type.c, 1.60, 1.61 value.h, 1.99, 1.100

Keith Packard commit at keithp.com
Sat Apr 10 23:06:55 PDT 2004


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv11956

Modified Files:
	ChangeLog array.c builtin-toplevel.c builtin.c compile.c 
	execute.c file.c gram.y hash.c lex.l main.c nickle.h pretty.c 
	type.c value.h 
Log Message:
2004-04-10  Keith Packard  <keithp at keithp.com>

	* array.c: (ArrayPrint), (ArrayResize):
	* builtin-toplevel.c: (do_setdims), (do_setdim):
	* builtin.c: (BuiltinType):
	* compile.c: (CompileArgs), (CompileTypecheckArgs),
	(CompileCountInitDimensions), (CompileBuildArray),
	(CompileSizeDimensions), (CompileImplicitArray),
	(CompileArrayInits), (CompileImplicitInit), (CompileArrayType),
	(InstDump):
	* execute.c: (ThreadArrayIndex), (ThreadsRun):
	* file.c: (FilePutDimensions), (FilePutSubscriptType):
	* gram.y:
	* hash.c: (HashGet), (HashSetDef), (HashRef):
	* lex.l:
	* main.c: (setArgv):
	* nickle.h:
	* pretty.c: (PrettyParameters), (PrettyArrayInits),
	(PrettyArrayInit):
	* type.c: (NewTypeArray), (TypeInit):
	* value.h:
	Make value distinction between resizable and unresizable
	arrays.  Types now use '...' for resizable arrays and '*'
	for unresizable arrays of unspecified size.
	
	Also fixed a bug in the implicit array dimension
	computation for multi-dimensional arrays -- the
	dimensions were compiled in the reverse order.


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- a/ChangeLog	11 Apr 2004 02:30:21 -0000	1.23
+++ b/ChangeLog	11 Apr 2004 06:06:51 -0000	1.24
@@ -1,5 +1,34 @@
 2004-04-10  Keith Packard  <keithp at keithp.com>
 
+	* array.c: (ArrayPrint), (ArrayResize):
+	* builtin-toplevel.c: (do_setdims), (do_setdim):
+	* builtin.c: (BuiltinType):
+	* compile.c: (CompileArgs), (CompileTypecheckArgs),
+	(CompileCountInitDimensions), (CompileBuildArray),
+	(CompileSizeDimensions), (CompileImplicitArray),
+	(CompileArrayInits), (CompileImplicitInit), (CompileArrayType),
+	(InstDump):
+	* execute.c: (ThreadArrayIndex), (ThreadsRun):
+	* file.c: (FilePutDimensions), (FilePutSubscriptType):
+	* gram.y:
+	* hash.c: (HashGet), (HashSetDef), (HashRef):
+	* lex.l:
+	* main.c: (setArgv):
+	* nickle.h:
+	* pretty.c: (PrettyParameters), (PrettyArrayInits),
+	(PrettyArrayInit):
+	* type.c: (NewTypeArray), (TypeInit):
+	* value.h:
+	Make value distinction between resizable and unresizable
+	arrays.  Types now use '...' for resizable arrays and '*'
+	for unresizable arrays of unspecified size.
+	
+	Also fixed a bug in the implicit array dimension
+	computation for multi-dimensional arrays -- the
+	dimensions were compiled in the reverse order.
+
+2004-04-10  Keith Packard  <keithp at keithp.com>
+
 	reviewed by: <delete if not using a buddy>
 
 	* compile.c: (CompileHashInit):

Index: array.c
===================================================================
RCS file: /local/src/CVS/nickle/array.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- a/array.c	27 Feb 2004 03:50:15 -0000	1.22
+++ b/array.c	11 Apr 2004 06:06:51 -0000	1.23
@@ -99,9 +99,12 @@
 	FilePuts (f, "[");
 	for (i = a->ndim - 1; i >= 0; i--)
 	{
-	    FilePutInt (f, limits[i]);
+	    if (a->resizable)
+		FilePuts (f, "...");
+	    else
+		FilePutInt (f, limits[i]);
 	    if (i)
-		FilePuts (f, ",");
+		FilePuts (f, ", ");
 	}
 	FilePuts (f, "]");
 	if (!TypePoly (ArrayType(a)))
@@ -232,6 +235,7 @@
     int	    *dims = ArrayDims(a);
     int	    *limits = ArrayLimits(a);
 
+    assert (av->array.resizable);
     if (dims[dim] < size || dims[dim] > size * 2)
     {
 	ENTER ();

Index: builtin-toplevel.c
===================================================================
RCS file: /local/src/CVS/nickle/builtin-toplevel.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- a/builtin-toplevel.c	27 Feb 2004 03:50:15 -0000	1.20
+++ b/builtin-toplevel.c	11 Apr 2004 06:06:51 -0000	1.21
@@ -356,6 +356,13 @@
 				2, NewInt (a->ndim), dv);
 	RETURN (Void);
     }
+    if (!av->array.resizable)
+    {
+	RaiseStandardException (exception_invalid_argument,
+				"setdims: array must be resizable",
+				1, av, Void);
+	RETURN (Void);
+    }
     for (i = 0; i < a->ndim; i++)
     {
 	dims[i] = IntPart (BoxValueGet (db,i), "setdims: invalid dimension");
@@ -384,7 +391,14 @@
     {
 	RaiseStandardException (exception_invalid_argument,
 				"setdim: dimension must be non-negative",
-				2, NewInt (d), Void);
+				2, dv, Void);
+	RETURN (Void);
+    }
+    if (!av->array.resizable)
+    {
+	RaiseStandardException (exception_invalid_argument,
+				"setdim: array must be resizable",
+				1, av, Void);
 	RETURN (Void);
     }
     ArrayResize (av, 0, d);

Index: builtin.c
===================================================================
RCS file: /local/src/CVS/nickle/builtin.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- a/builtin.c	27 Feb 2004 03:50:15 -0000	1.16
+++ b/builtin.c	11 Apr 2004 06:06:51 -0000	1.17
@@ -172,7 +172,7 @@
     if (ref)
 	t = NewTypeRef (t, False);
     if (array)
-	t = NewTypeArray (t, dims);
+	t = NewTypeArray (t, dims, False);
     if (hash)
 	t = NewTypeHash (t, k);
     *type = t;

Index: compile.c
===================================================================
RCS file: /local/src/CVS/nickle/compile.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- a/compile.c	11 Apr 2004 02:30:21 -0000	1.146
+++ b/compile.c	11 Apr 2004 06:06:51 -0000	1.147
@@ -928,7 +928,7 @@
     {
 	if (pushValue)
 	    SetPush (obj);
-	if (arg->tree.left->base.tag == DOTS)
+	if (arg->tree.left->base.tag == DOTDOTDOT)
 	{
 	    InstPtr inst;
 	    obj = _CompileExpr (obj, arg->tree.left->tree.left, True, stat, code);
@@ -995,7 +995,7 @@
 		ret = False;
 		break;
 	    }
-	    varactual = arg->tree.left->base.tag == DOTS;
+	    varactual = arg->tree.left->base.tag == DOTDOTDOT;
 	    if (varactual)
 		actual_type = TypeCombineArray (arg->tree.left->tree.left->base.type, 1, False);
 	    else
@@ -1250,7 +1250,7 @@
 	ndimMax = 0;
 	while (expr)
 	{
-	    if (expr->tree.left && expr->tree.left->base.tag != DOTS)
+	    if (expr->tree.left && expr->tree.left->base.tag != DOTDOTDOT)
 	    {
 		ndimSub = CompileCountInitDimensions (type, expr->tree.left);
 		if (ndimSub < 0)
@@ -1324,6 +1324,7 @@
     }
     inst->array.ndim = ndim;
     inst->array.type = type->array.type;
+    inst->array.resizable = type->array.resizable;
     RETURN (obj);
 }
 
@@ -1340,7 +1341,7 @@
 	expr = expr->tree.left;
 	while (expr)
 	{
-	    if (expr->tree.left->base.tag == DOTS)
+	    if (expr->tree.left->base.tag == DOTDOTDOT)
 		return False;
 	    if (ndims != 1)
 	    {
@@ -1360,7 +1361,7 @@
 	break;
     default:
 	dim = 1;
-	if (expr->tree.left->base.tag == DOTS)
+	if (expr->tree.left->base.tag == DOTDOTDOT)
 	    return False;
 	if (ndims != 1)
 	    CompileSizeDimensions (expr, dims + 1, ndims - 1);
@@ -1387,10 +1388,10 @@
 	RETURN (0);
     }
     sub = 0;
-    for (n = 0; n < ndim; n++)
+    for (n = ndim - 1; n >= 0; n--)
     {
 	sub = NewExprTree (COMMA,
-			   NewExprConst (TEN_NUM, NewInt (*dims++)),
+			   NewExprConst (TEN_NUM, NewInt (dims[n])),
 			   sub);
     }
     RETURN(sub);
@@ -1493,7 +1494,7 @@
 		AInitMode   subMode = AInitModeElement;
 		
 		next = e->tree.right;
-		if (next && next->tree.left->base.tag == DOTS)
+		if (next && next->tree.left->base.tag == DOTDOTDOT)
 		{
 		    subMode = AInitModeRepeat;
 		    next = next->tree.right;
@@ -1601,12 +1602,12 @@
  *                       COMMA     0
  *                      /     \
  *                   ARRAY     COMMA
- *                  /     \    |    \
- *               COMMA     0  DOTS   0
+ *                  /     \    |      \
+ *               COMMA     0 DOTDOTDOT  0
  *              /     \
  *          STRUCT     COMMA
- *         /      \    |    \
- *      COMMA      0   DOTS  0
+ *         /      \    |      \
+ *      COMMA      0 DOTDOTDOT  0
  *     /     \
  *  ASSIGN    0
  *  |     \
@@ -1848,7 +1849,7 @@
 					NewExprTree (COMMA,
 						     init,
 						     NewExprTree (COMMA,
-								  NewExprTree (DOTS, 0, 0),
+								  NewExprTree (DOTDOTDOT, 0, 0),
 								  0)),
 					0);
 		}
@@ -3876,6 +3877,7 @@
 	SetPush (*initObj);
 	BuildInst (*initObj, OpBuildArray, inst, stat);
 	inst->array.ndim = 1;
+	inst->array.resizable = False;
 	inst->array.type = typePrim[rep_integer];
 	/*
 	 * Initialize the dimension array
@@ -4324,7 +4326,9 @@
 	FilePrintf (FileStdout, "%d args", inst->ints.value);
 	break;
     case OpBuildArray:
-	FilePrintf (FileStdout, "%d dims", inst->ints.value);
+	FilePrintf (FileStdout, "%d dims %sresizable",
+		    inst->array.ndim,
+		    inst->array.resizable ? "" : "un");
 	break;
     case OpInitArray:
 	FilePrintf (FileStdout, "%d %s",

Index: execute.c
===================================================================
RCS file: /local/src/CVS/nickle/execute.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- a/execute.c	11 Apr 2004 02:30:21 -0000	1.87
+++ b/execute.c	11 Apr 2004 06:06:51 -0000	1.88
@@ -374,7 +374,7 @@
 	}
 	if (limits[dim] <= part)
 	{
-	    if (resize)
+	    if (resize && array->array.resizable)
 	    {
 		if (dims[dim] > part)
 		    limits[dim] = part + 1;
@@ -1105,12 +1105,12 @@
 		    break;
 		case OpBuildArray:
 		    stack = inst->array.ndim;
-		    /* XXX resizable? */
-		    value = ThreadArray (thread, True, stack, inst->array.type);
+		    value = ThreadArray (thread, inst->array.resizable,
+					 stack, inst->array.type);
 		    break;
 		case OpBuildArrayInd:
-		    /* XXX resizable? */
-		    value = ThreadArrayInd (thread, True, value, inst->array.type);
+		    value = ThreadArrayInd (thread, inst->array.resizable,
+					    value, inst->array.type);
 		    break;
 		case OpInitArray:
 		    stack = 0;

Index: file.c
===================================================================
RCS file: /local/src/CVS/nickle/file.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- a/file.c	27 Feb 2004 03:50:16 -0000	1.59
+++ b/file.c	11 Apr 2004 06:06:52 -0000	1.60
@@ -1513,12 +1513,14 @@
 }
 
 static void
-FilePutDimensions (Value f, ExprPtr dims)
+FilePutDimensions (Value f, ExprPtr dims, Bool resizable)
 {
     while (dims)
     {
 	if (dims->tree.left)
 	    PrettyExpr (f, dims->tree.left, -1, 0, False, 0);
+	else if (resizable)
+	    FilePuts (f, "...");
 	else
 	    FilePuts (f, "*");
 	if (dims->tree.right)
@@ -1574,7 +1576,7 @@
 	break;
     case type_array:
 	FilePuts (f, "[");
-	FilePutDimensions (f, t->array.dimensions);
+	FilePutDimensions (f, t->array.dimensions, t->array.resizable);
 	FilePuts (f, "]");
 	FilePutSubscriptType (f, t->array.type, minimal);
 	break;

Index: gram.y
===================================================================
RCS file: /local/src/CVS/nickle/gram.y,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- a/gram.y	11 Apr 2004 02:30:22 -0000	1.128
+++ b/gram.y	11 Apr 2004 06:06:52 -0000	1.129
@@ -116,7 +116,7 @@
 %type  <expr>	    opt_init
 %type  <fulltype>   decl next_decl
 %type  <type>	    opt_type type subscripts subtype
-%type  <expr>	    opt_stars stars
+%type  <expr>	    opt_stars stars dotdotdots
 %type  <type>	    basetype
 %type  <expr>	    dims
 %type  <memList>    struct_members union_members
@@ -128,7 +128,7 @@
 %type  <argDecl>    argdecl
 %type  <argType>    opt_argdefines argdefines args
 %type  <argDecl>    argdefine
-%type  <bool>	    opt_dots
+%type  <bool>	    opt_dotdotdot
 
 %type  <expr>	    opt_expr expr opt_exprs exprs simpleexpr primary
 %type  <expr>	    opt_actuals actuals
@@ -142,7 +142,7 @@
 
 %token		    VAR EXPR ARRAY STRUCT UNION ENUM COMP HASH
 
-%token		    NL SEMI MOD OC CC DOLLAR DOTS
+%token		    NL SEMI MOD OC CC DOLLAR DOTDOTDOT
 %token <class>	    GLOBAL AUTO STATIC CONST
 %token <type>	    POLY INTEGER NATURAL RATIONAL REAL STRING
 %token <type>	    FILET MUTEX SEMAPHORE CONTINUATION THREAD VOID BOOL
@@ -826,9 +826,11 @@
 subscripts	: opt_argdecls subscripts	    %prec CALL
 		    { $$ = NewTypeFunc ($2, $1); }
 		| OS opt_stars CS subscripts    
-		    { $$ = NewTypeArray ($4, $2); }
+		    { $$ = NewTypeArray ($4, $2, False); }
+		| OS dotdotdots CS subscripts    
+		    { $$ = NewTypeArray ($4, $2, True); }
 		| OS dims CS subscripts
-		    { $$ = NewTypeArray ($4, $2); }
+		    { $$ = NewTypeArray ($4, $2, False); }
 		| OS type CS subscripts
 		    { $$ = NewTypeHash ($4, $2); }
 		|
@@ -972,6 +974,11 @@
 		| TIMES
 		    { $$ = NewExprTree (COMMA, 0, 0); }
 		;
+dotdotdots	: dotdotdots COMMA DOTDOTDOT
+		    { $$ = NewExprTree (COMMA, 0, $1); }
+		| DOTDOTDOT
+		    { $$ = NewExprTree (COMMA, 0, 0); }
+		;
 dims		: simpleexpr COMMA dims
 		    { $$ = NewExprTree (COMMA, $1, $3); }
 		| simpleexpr
@@ -1021,7 +1028,7 @@
 		;
 argdecls	: argdecl COMMA argdecls
 		    { $$ = NewArgType ($1.type, False, $1.name, 0, $3); }
-		| argdecl opt_dots
+		| argdecl opt_dotdotdot
 		    { $$ = NewArgType ($1.type, $2, $1.name, 0, 0); }
 		;
 argdecl		: type NAME
@@ -1060,7 +1067,8 @@
 						     NewExprTree (COMMA,
 								  NewExprConst (TEN_NUM, 
 										NewInt (0)),
-								  0));
+								  0),
+						     False);
 			    }
 			    args->symbol = ParseNewSymbol (publish_private,
 							   class_arg, 
@@ -1073,7 +1081,7 @@
 		;
 argdefines	: argdefine COMMA argdefines
 		    { $$ = NewArgType ($1.type, False, $1.name, 0, $3); }
-		| argdefine opt_dots
+		| argdefine opt_dotdotdot
 		    { $$ = NewArgType ($1.type, $2, $1.name, 0, 0); }
 		;
 argdefine	: opt_type NAME
@@ -1081,7 +1089,7 @@
 		| type
 		    { $$.type = $1; $$.name = 0; }
 		;
-opt_dots	: DOTS
+opt_dotdotdot	: DOTDOTDOT
 		    { $$ = True; }
 		|
 		    { $$ = False; }
@@ -1133,9 +1141,9 @@
 		;
 actuals		: simpleexpr COMMA actuals
 		    { $$ = NewExprTree (COMMA, $1, $3); }
-		| simpleexpr opt_dots
+		| simpleexpr opt_dotdotdot
 		    {	
-			ExprPtr	arg = $2 ? NewExprTree (DOTS, $1, 0) : $1;
+			ExprPtr	arg = $2 ? NewExprTree (DOTDOTDOT, $1, 0) : $1;
 			$$ = NewExprTree (COMMA, arg, 0); 
 		    }
 		;
@@ -1306,14 +1314,14 @@
 		    }
 		| OP OS stars CS CP namespace_start arrayinit namespace_end
 		    { 
-			$7->base.type = NewTypeArray (typePoly, $3); 
+			$7->base.type = NewTypeArray (typePoly, $3, True); 
 			ParseCanonType ($7->base.type, False);
 			$$ = NewExprTree (NEW, $7, 0); 
 			$$->base.type = $7->base.type;
 		    }
 		| OP OS dims CS CP namespace_start opt_arrayinit namespace_end
 		    { 
-			$7->base.type = NewTypeArray (typePoly, $3);
+			$7->base.type = NewTypeArray (typePoly, $3, False);
 			ParseCanonType ($7->base.type, False);
 			$$ = NewExprTree (NEW, $7, 0); 
 			$$->base.type = $7->base.type;
@@ -1380,7 +1388,7 @@
 		|
 		    { $$ = 0; }
 		;
-arrayinit    	: OC arrayelts opt_comma opt_dots CC
+arrayinit    	: OC arrayelts opt_comma opt_dotdotdot CC
 		    { 
 			ExprPtr	elts = $2 ? ExprRehang ($2, 0) : 0;
 			if ($4)
@@ -1389,7 +1397,7 @@
 			    while (i->tree.right)
 				i = i->tree.right;
 			    i->tree.right = NewExprTree (COMMA, 
-							 NewExprTree (DOTS, 0, 0),
+							 NewExprTree (DOTDOTDOT, 0, 0),
 							 0);
 			}
 			$$ = NewExprTree (ARRAY, elts, 0); 

Index: hash.c
===================================================================
RCS file: /local/src/CVS/nickle/hash.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/hash.c	11 Apr 2004 02:30:22 -0000	1.4
+++ b/hash.c	11 Apr 2004 06:06:52 -0000	1.5
@@ -310,11 +310,16 @@
     he = Find (ht, hash, key);
     if (!HashEltValid (he))
     {
-	if (ht->def)
-	    return ht->def;
-	RaiseStandardException (exception_uninitialized_value,
-				"uninitialized hash element", 0);
-	return (Void);
+	if (!ht->def)
+	{
+	    RaiseStandardException (exception_uninitialized_value,
+				    "uninitialized hash element", 0);
+	    return (Void);
+	}
+	ht->count++;
+	HashEltHash(he) = hash;
+	HashEltKey(he) = key;
+	HashEltValue(he) = Copy(ht->def);
     }
     return HashEltValue (he);
 }
@@ -344,7 +349,7 @@
 {
     HashTablePtr    ht = &hv->hash;
 
-    ht->def = def;
+    ht->def = Copy(def);
 }
 
 Value
@@ -367,7 +372,7 @@
 	HashEltHash (he) = hash;
 	HashEltKey (he) = key;
 	if (ht->def)
-	    HashEltValue (he) = ht->def;
+	    HashEltValue (he) = Copy(ht->def);
     }
     RETURN (NewRef (ht->elts, 
 		    &HashEltValue(he) - BoxElements (ht->elts)));

Index: lex.l
===================================================================
RCS file: /local/src/CVS/nickle/lex.l,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- a/lex.l	27 Feb 2004 03:50:16 -0000	1.70
+++ b/lex.l	11 Apr 2004 06:06:52 -0000	1.71
@@ -344,7 +344,7 @@
 ";"		{ yylval.ints = SEMI; return SEMI; }
 ","		{ yylval.ints = COMMA; return COMMA; }
 "$"		{ yylval.ints = DOLLAR; return DOLLAR; }
-"..."		{ yylval.ints = DOTS; return DOTS; }
+"..."		{ yylval.ints = DOTDOTDOT; return DOTDOTDOT; }
 "."		{ yylval.ints = DOT; return DOT; }
 "->"		{ yylval.ints = ARROW; return ARROW; }
 "=>"		{ yylval.ints = DARROW; return DARROW; }

Index: main.c
===================================================================
RCS file: /local/src/CVS/nickle/main.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- a/main.c	27 Feb 2004 03:50:16 -0000	1.35
+++ b/main.c	11 Apr 2004 06:06:52 -0000	1.36
@@ -34,7 +34,7 @@
 	BoxValueSet (args->array.values, i, NewStrString (argv[i]));
     setVar (GlobalNamespace, "argv", args, 
 	    NewTypeArray (typePrim[rep_string],
-			   NewExprTree (COMMA, 0, 0)));
+			   NewExprTree (COMMA, 0, 0), False));
     EXIT ();
 }
 

Index: nickle.h
===================================================================
RCS file: /local/src/CVS/nickle/nickle.h,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- a/nickle.h	27 Feb 2004 03:50:16 -0000	1.113
+++ b/nickle.h	11 Apr 2004 06:06:52 -0000	1.114
@@ -396,7 +396,8 @@
 
 typedef struct _instArray {
     InstBase	inst;
-    int		ndim;
+    short    	ndim;
+    short	resizable;
     TypePtr	type;
 } InstArray;
 

Index: pretty.c
===================================================================
RCS file: /local/src/CVS/nickle/pretty.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- a/pretty.c	27 Feb 2004 03:50:16 -0000	1.65
+++ b/pretty.c	11 Apr 2004 06:06:52 -0000	1.66
@@ -146,7 +146,7 @@
 {
     while (e) 
     {
-	if (e->tree.left->base.tag == DOTS)
+	if (e->tree.left->base.tag == DOTDOTDOT)
 	{
 	    PrettyExpr (f, e->tree.left->tree.left, -1, 0, nest, pd);
 	    FilePuts (f, "...");
@@ -174,7 +174,7 @@
 	e = e->tree.right;
 	if (e)
 	{
-	    if (e->tree.left->base.tag == DOTS)
+	    if (e->tree.left->base.tag == DOTDOTDOT)
 		FilePuts (f, " ");
 	    else
 		FilePuts (f, ", ");
@@ -191,7 +191,7 @@
 	PrettyArrayInits (f, e->tree.left, level, nest, pd);
 	FilePuts (f, " }");
 	break;
-    case DOTS:
+    case DOTDOTDOT:
 	FilePuts (f, "...");
 	break;
     default:

Index: type.c
===================================================================
RCS file: /local/src/CVS/nickle/type.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- a/type.c	11 Apr 2004 02:30:22 -0000	1.60
+++ b/type.c	11 Apr 2004 06:06:52 -0000	1.61
@@ -179,7 +179,7 @@
 }
 
 Type *
-NewTypeArray (Type *type, Expr *dimensions)
+NewTypeArray (Type *type, Expr *dimensions, Bool resizable)
 {
     ENTER ();
     Type   *t;
@@ -189,6 +189,7 @@
     t->array.type = type;
     t->array.dimensions = dimensions;
     t->array.storage = DimStorageNone;
+    t->array.resizable = resizable;
     RETURN (t);
 }
 
@@ -1203,7 +1204,7 @@
 					  NewTypeElt (typePrim[rep_float], 0)));
     MemAddRoot (typeField);
     
-    typeArrayInt = NewTypeArray (typePrim[rep_integer], 0);
+    typeArrayInt = NewTypeArray (typePrim[rep_integer], 0, False);
     MemAddRoot (typeArrayInt);
 
     TypeCheckStack = StackCreate ();

Index: value.h
===================================================================
RCS file: /local/src/CVS/nickle/value.h,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- a/value.h	11 Apr 2004 02:30:22 -0000	1.99
+++ b/value.h	11 Apr 2004 06:06:52 -0000	1.100
@@ -395,6 +395,7 @@
     ExprPtr	dimensions;
     int		dims;
     DimStorage	storage;
+    Bool	resizable;
     union {
 	BoxPtr	global;
 	struct {
@@ -462,7 +463,7 @@
 Type	*NewTypeRef (Type *ref, Bool pointer);
 Type	*NewTypePointer (Type *ref);
 Type	*NewTypeFunc (Type *ret, ArgType *args);
-Type	*NewTypeArray (Type *type, ExprPtr dimensions);
+Type	*NewTypeArray (Type *type, ExprPtr dimensions, Bool resizable);
 Type	*NewTypeHash (Type *type, Type *keyType);
 Type	*NewTypeStruct (StructTypePtr structs);
 Type	*NewTypeUnion (StructTypePtr structs, Bool enumeration);




More information about the Commit mailing list