From: sewardj Date: Tue, 11 Jan 2000 17:23:39 +0000 (+0000) Subject: [project @ 2000-01-11 17:23:39 by sewardj] X-Git-Tag: Approximately_9120_patches~5314 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=41ab0a824dc5b9fc7eb11009c6c033fa75bf63c5;p=ghc-hetmet.git [project @ 2000-01-11 17:23:39 by sewardj] Handle tuple types (,,,) --> Z3T in enZcodeThenFindText(). --- diff --git a/ghc/interpreter/storage.c b/ghc/interpreter/storage.c index 4856021..9d10e43 100644 --- a/ghc/interpreter/storage.c +++ b/ghc/interpreter/storage.c @@ -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;