comparison src/cjr_print.sml @ 470:7cb418e9714f

Tree demo works
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 18:49:38 -0500
parents 4efab85405be
children 20fab0e96217
comparison
equal deleted inserted replaced
469:b393c2fc80f8 470:7cb418e9714f
68 | TFfi ("Basis", "string") => true 68 | TFfi ("Basis", "string") => true
69 | _ => false 69 | _ => false
70 70
71 fun p_typ' par env (t, loc) = 71 fun p_typ' par env (t, loc) =
72 case t of 72 case t of
73 TFun (t1, t2) => parenIf par (box [p_typ' true env t2, 73 TFun (t1, t2) => parenIf par (box [string "(",
74 p_typ' true env t2,
74 space, 75 space,
75 string "(*)", 76 string "(*)",
76 space, 77 space,
77 string "(", 78 string "(",
78 p_typ env t1, 79 p_typ env t1,
79 string ")"]) 80 string "))"])
80 | TRecord i => box [string "struct", 81 | TRecord i => box [string "struct",
81 space, 82 space,
82 string "__uws_", 83 string "__uws_",
83 string (Int.toString i)] 84 string (Int.toString i)]
84 | TDatatype (Enum, n, _) => 85 | TDatatype (Enum, n, _) =>
1149 string "=", 1150 string "=",
1150 space, 1151 space,
1151 p_exp env initial, 1152 p_exp env initial,
1152 string ";", 1153 string ";",
1153 newline, 1154 newline,
1155 case prepared of
1156 NONE => box [string "printf(\"Executing: %s\\n\", query);",
1157 newline]
1158 | _ => box [],
1154 string "PGresult *res = ", 1159 string "PGresult *res = ",
1155 case prepared of 1160 case prepared of
1156 NONE => string "PQexecParams(conn, query, 0, NULL, NULL, NULL, NULL, 0);" 1161 NONE => string "PQexecParams(conn, query, 0, NULL, NULL, NULL, NULL, 0);"
1157 | SOME n => box [string "PQexecPrepared(conn, \"uw", 1162 | SOME n => box [string "PQexecPrepared(conn, \"uw",
1158 string (Int.toString n), 1163 string (Int.toString n),