changeset 199:c938fe391c84

strings get 'Option' datatype handling; fix datatype unurlifying
author Adam Chlipala <adamc@hcoop.net>
date Sat, 09 Aug 2008 19:46:12 -0400
parents ab86aa858e6c
children 5dbba661deab
files src/c/lacweb.c src/cjr_print.sml
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/lacweb.c	Sat Aug 09 19:23:31 2008 -0400
+++ b/src/c/lacweb.c	Sat Aug 09 19:46:12 2008 -0400
@@ -543,8 +543,6 @@
   int len = strlen(s1) + strlen(s2) + 1;
   char *s;
 
-  printf("s1 = %s\ns2 = %s\n", s1, s2);
-
   lw_check_heap(ctx, len);
 
   s = ctx->heap_front;
@@ -553,7 +551,5 @@
   strcat(s, s2);
   ctx->heap_front += len;
 
-  printf("s = %s\n", s);
-
   return s;
 }
--- a/src/cjr_print.sml	Sat Aug 09 19:23:31 2008 -0400
+++ b/src/cjr_print.sml	Sat Aug 09 19:46:12 2008 -0400
@@ -80,6 +80,7 @@
            | SOME t =>
              case #1 t of
                  TDatatype _ => p_typ' par env t
+               | TFfi ("Basis", "string") => p_typ' par env t
                | _ => box [p_typ' par env t,
                            string "*"])
       | TDatatype (Default, n, _) =>
@@ -216,6 +217,8 @@
                                   case #1 t of
                                       TDatatype _ => box [string "disc",
                                                           string (Int.toString depth)]
+                                    | TFfi ("Basis", "string") => box [string "disc",
+                                                                       string (Int.toString depth)]
                                     | _ => box [string "*disc",
                                                 string (Int.toString depth)],
                               string ";",
@@ -336,6 +339,7 @@
         in
             case #1 t of
                 TDatatype _ => p_exp' par env e
+              | TFfi ("Basis", "string") => p_exp' par env e
               | _ => box [string "({",
                           newline,
                           p_typ env t,
@@ -914,6 +918,7 @@
                          
                          case #1 t of
                              TDatatype _ => unurlify t
+                           | TFfi ("Basis", "string") => unurlify t
                            | _ => box [string "({",
                                        newline,
                                        p_typ env t,
@@ -985,8 +990,6 @@
                                  string (Int.toString (size x')),
                                  string ";",
                                  newline,
-                                 string "if (request[0] == '/') ++request;",
-                                 newline,
                                  case to of
                                      NONE => box []
                                    | SOME t => box [string "tmp->data.lw_",