[project @ 2000-01-11 17:23:39 by sewardj]
authorsewardj <unknown>
Tue, 11 Jan 2000 17:23:39 +0000 (17:23 +0000)
committersewardj <unknown>
Tue, 11 Jan 2000 17:23:39 +0000 (17:23 +0000)
Handle tuple types (,,,) --> Z3T in enZcodeThenFindText().

ghc/interpreter/storage.c

index 4856021..9d10e43 100644 (file)
@@ -9,8 +9,8 @@
  * included in the distribution.
  *
  * $RCSfile: storage.c,v $
- * $Revision: 1.38 $
- * $Date: 2000/01/11 15:40:57 $
+ * $Revision: 1.39 $
+ * $Date: 2000/01/11 17:23:39 $
  * ------------------------------------------------------------------------*/
 
 #include "prelude.h"
@@ -353,6 +353,19 @@ Text enZcodeThenFindText ( String s )
          p[n] = *s; n++; s++;
          continue;
       }
+      if (*s == '(') {
+         int tup = 0;
+         char num[12];
+         s++;
+         while (*s && *s==',') { s++; tup++; };
+         if (*s != ')') internal("enZcodeThenFindText: invalid tuple type");
+         s++;
+         p[n++] = 'Z';
+         sprintf(num,"%d",tup);
+         p[n] = 0; strcat ( &(p[n]), num ); n += strlen(num);
+         p[n++] = 'T';
+         continue;         
+      }
       switch (*s++) {
          case '(': p[n++] = 'Z'; p[n++] = 'L'; break;
          case ')': p[n++] = 'Z'; p[n++] = 'R'; break;