comparison src/cjr_print.sml @ 995:166ea3944b91

Versioned1 demo working
author Adam Chlipala <adamc@hcoop.net>
date Tue, 06 Oct 2009 17:36:45 -0400
parents e2305dcc3965
children 16f7cb0891b6
comparison
equal deleted inserted replaced
994:7932d577cf78 995:166ea3944b91
533 ((PCon (_, PConFfi {mod = "Basis", con = "False", ...}, _), _), 533 ((PCon (_, PConFfi {mod = "Basis", con = "False", ...}, _), _),
534 (EPrim (Prim.String "FALSE"), _))], 534 (EPrim (Prim.String "FALSE"), _))],
535 _) => [(e, Bool)] 535 _) => [(e, Bool)]
536 536
537 | _ => raise Fail "CjrPrint: getPargs" 537 | _ => raise Fail "CjrPrint: getPargs"
538
539 fun p_ensql t e =
540 case t of
541 Int => box [string "uw_Basis_attrifyInt(ctx, ", e, string ")"]
542 | Float => box [string "uw_Basis_attrifyFloat(ctx, ", e, string ")"]
543 | String => e
544 | Bool => box [string "(", e, string " ? \"TRUE\" : \"FALSE\")"]
545 | Time => box [string "uw_Basis_attrifyTime(ctx, ", e, string ")"]
546 | Blob => box [e, string ".data"]
547 | Channel => box [string "uw_Basis_attrifyChannel(ctx, ", e, string ")"]
548 | Client => box [string "uw_Basis_attrifyClient(ctx, ", e, string ")"]
549 | Nullable String => e
550 | Nullable t => box [string "(",
551 e,
552 string " == NULL ? NULL : ",
553 p_ensql t (box [string "(*", e, string ")"]),
554 string ")"]
555 538
556 fun notLeaky env allowHeapAllocated = 539 fun notLeaky env allowHeapAllocated =
557 let 540 let
558 fun nl ok (t, _) = 541 fun nl ok (t, _) =
559 case t of 542 case t of