comparison src/mono_opt.sml @ 717:e28637743279

URLs
author Adam Chlipala <adamc@hcoop.net>
date Thu, 09 Apr 2009 16:36:50 -0400
parents 0f42461273cf
children 9864b64b1700
comparison
equal deleted inserted replaced
716:a6941960f459 717:e28637743279
28 structure MonoOpt :> MONO_OPT = struct 28 structure MonoOpt :> MONO_OPT = struct
29 29
30 open Mono 30 open Mono
31 structure U = MonoUtil 31 structure U = MonoUtil
32 32
33 val bless = ref (fn _ : string => true)
34
33 fun typ t = t 35 fun typ t = t
34 fun decl d = d 36 fun decl d = d
35 37
36 fun attrifyInt n = 38 fun attrifyInt n =
37 if n < 0 then 39 if n < 0 then
369 | ESignalBind ((ESignalReturn e1, loc), e2) => 371 | ESignalBind ((ESignalReturn e1, loc), e2) =>
370 optExp (EApp (e2, e1), loc) 372 optExp (EApp (e2, e1), loc)
371 373
372 | EJavaScript (_, _, SOME (e, _)) => e 374 | EJavaScript (_, _, SOME (e, _)) => e
373 375
376 | EFfiApp ("Basis", "bless", [(se as EPrim (Prim.String s), loc)]) =>
377 (if !bless s then
378 ()
379 else
380 ErrorMsg.errorAt loc "Invalid URL passed to 'bless'";
381 se)
382
374 | EFfiApp ("Basis", "checkString", [(EPrim (Prim.String s), loc)]) => 383 | EFfiApp ("Basis", "checkString", [(EPrim (Prim.String s), loc)]) =>
375 let 384 let
376 fun uwify (cs, acc) = 385 fun uwify (cs, acc) =
377 case cs of 386 case cs of
378 [] => String.concat (rev acc) 387 [] => String.concat (rev acc)