comparison src/cjr_print.sml @ 2056:a9159911c3ba

New phase: Dbmodecheck
author Adam Chlipala <adam@chlipala.net>
date Sun, 17 Aug 2014 13:07:56 -0400
parents 4d64af730e35
children ebfaab689570 ef766ef6e242
comparison
equal deleted inserted replaced
2055:7c2229aa22fc 2056:a9159911c3ba
2632 [("1", t'), ("2", _)] => flatFields [] t' 2632 [("1", t'), ("2", _)] => flatFields [] t'
2633 | _ => raise Fail "CjrPrint: Bad struct for TList" 2633 | _ => raise Fail "CjrPrint: Bad struct for TList"
2634 end 2634 end
2635 | _ => NONE 2635 | _ => NONE
2636 2636
2637 val fields = foldl (fn ((ek, _, _, ts, _, _, _), fields) => 2637 val fields = foldl (fn ((ek, _, _, ts, _, _, _, _), fields) =>
2638 case ek of 2638 case ek of
2639 Action eff => 2639 Action eff =>
2640 (case List.nth (ts, length ts - 2) of 2640 (case List.nth (ts, length ts - 2) of
2641 (TRecord i, loc) => 2641 (TRecord i, loc) =>
2642 let 2642 let
2954 scripts 2954 scripts
2955 ^ "<script type=\\\"text/javascript\\\" src=\\\"" ^ x ^ "\\\"></script>\\n") 2955 ^ "<script type=\\\"text/javascript\\\" src=\\\"" ^ x ^ "\\\"></script>\\n")
2956 scripts (Settings.getScripts ()) 2956 scripts (Settings.getScripts ())
2957 end 2957 end
2958 2958
2959 fun p_page (ek, s, n, ts, ran, side, tellSig) = 2959 fun p_page (ek, s, n, ts, ran, side, dbmode, tellSig) =
2960 let 2960 let
2961 val (ts, defInputs, inputsVar, fields) = 2961 val (ts, defInputs, inputsVar, fields) =
2962 case ek of 2962 case ek of
2963 Core.Action _ => 2963 Core.Action _ =>
2964 (case List.nth (ts, length ts - 2) of 2964 (case List.nth (ts, length ts - 2) of
3104 newline]), 3104 newline]),
3105 string "uw_set_could_write_db(ctx, ", 3105 string "uw_set_could_write_db(ctx, ",
3106 string (if couldWriteDb ek then "1" else "0"), 3106 string (if couldWriteDb ek then "1" else "0"),
3107 string ");", 3107 string ");",
3108 newline, 3108 newline,
3109 string "uw_set_at_most_one_query(ctx, ",
3110 string (case dbmode of OneQuery => "1" | _ => "0"),
3111 string ");",
3112 newline,
3109 string "uw_set_needs_push(ctx, ", 3113 string "uw_set_needs_push(ctx, ",
3110 string (case side of 3114 string (case side of
3111 ServerAndPullAndPush => "1" 3115 ServerAndPullAndPush => "1"
3112 | _ => "0"), 3116 | _ => "0"),
3113 string ");", 3117 string ");",