assigning to strings, large expressions
authorMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 19 Jan 1982 16:09:16 +0000 (08:09 -0800)
committerMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 19 Jan 1982 16:09:16 +0000 (08:09 -0800)
SCCS-vsn: usr.bin/pascal/pdx/sym/predicates.c 1.2
SCCS-vsn: usr.bin/pascal/pdx/sym/print.c 1.2
SCCS-vsn: usr.bin/pascal/pdx/sym/printval.c 1.2

usr/src/usr.bin/pascal/pdx/sym/predicates.c
usr/src/usr.bin/pascal/pdx/sym/print.c
usr/src/usr.bin/pascal/pdx/sym/printval.c

index 9fa08f7..68514e9 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)predicates.c 1.1 %G%";
+static char sccsid[] = "@(#)predicates.c 1.2 %G%";
 
 /*
  * The basic tests on a symbol.
 
 /*
  * The basic tests on a symbol.
@@ -9,6 +9,7 @@ static char sccsid[] = "@(#)predicates.c 1.1 %G%";
 #include "defs.h"
 #include "sym.h"
 #include "symtab.h"
 #include "defs.h"
 #include "sym.h"
 #include "symtab.h"
+#include "btypes.h"
 #include "classes.h"
 #include "sym.rep"
 
 #include "classes.h"
 #include "sym.rep"
 
@@ -85,6 +86,9 @@ register SYM *t1, *t2;
                  (t2->class == SCAL || t2->class == CONST)) {
                        return TRUE;
                }
                  (t2->class == SCAL || t2->class == CONST)) {
                        return TRUE;
                }
+               if (t1->type == t_char && t1->class == ARRAY && t2->class == ARRAY) {
+                       return TRUE;
+               }
        }
 /*
  * A kludge here for "nil".  Should be handled better.
        }
 /*
  * A kludge here for "nil".  Should be handled better.
@@ -117,7 +121,7 @@ SYM *f;
                return(FALSE);
        } else {
                t = rtype(s->type);
                return(FALSE);
        } else {
                t = rtype(s->type);
-               if (t == NIL || t->class == FILET) {
+               if (t == NIL || t->class == FILET || t->class == SET) {
                        return(FALSE);
                } else {
                        return(TRUE);
                        return(FALSE);
                } else {
                        return(TRUE);
index 9dc1a0b..e8d7851 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)print.c 1.1 %G%";
+static char sccsid[] = "@(#)print.c 1.2 %G%";
 
 /*
  * Routines to print out symbols.
 
 /*
  * Routines to print out symbols.
@@ -116,13 +116,15 @@ FRAME *frame;
                addr = address(s, frame);
                len = size(s);
        }
                addr = address(s, frame);
                len = size(s);
        }
-       dread(sp, addr, len);
-       sp += len;
        printf("%s = ", s->symbol);
        printf("%s = ", s->symbol);
-       if (s->class == REF || s->class == VAR) {
-               printval(s->type);
+       if (!rpush(addr, len)) {
+               printf("*** expression too large ***");
        } else {
        } else {
-               printval(s);
+               if (s->class == REF || s->class == VAR) {
+                       printval(s->type);
+               } else {
+                       printval(s);
+               }
        }
 }
 
        }
 }
 
index 689a636..3cd5fc5 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)printval.c 1.1 %G%";
+static char sccsid[] = "@(#)printval.c 1.2 %G%";
 
 /*
  * Print out the value at the top of the stack using the given type.
 
 /*
  * Print out the value at the top of the stack using the given type.
@@ -31,7 +31,7 @@ SYM *s;
                        if (t==t_char || (t->class==RANGE && t->type==t_char)) {
                                len = size(s);
                                sp -= len;
                        if (t==t_char || (t->class==RANGE && t->type==t_char)) {
                                len = size(s);
                                sp -= len;
-                               printf("'%s'", sp);
+                               printf("'%.*s'", len, sp);
                                break;
                        } else {
                                printarray(s);
                                break;
                        } else {
                                printarray(s);