diff options
Diffstat (limited to 'src/mono_opt.sml')
-rw-r--r-- | src/mono_opt.sml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mono_opt.sml b/src/mono_opt.sml index 670774a2..19244e60 100644 --- a/src/mono_opt.sml +++ b/src/mono_opt.sml @@ -31,6 +31,7 @@ open Mono structure U = MonoUtil val bless = ref (fn _ : string => true) +val blessMime = ref (CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"-" orelse ch = #"/" orelse ch = #".")) fun typ t = t fun decl d = d @@ -386,6 +387,12 @@ fun exp e = else ErrorMsg.errorAt loc "Invalid URL passed to 'bless'"; se) + | EFfiApp ("Basis", "blessMime", [(se as EPrim (Prim.String s), loc)]) => + (if !blessMime s then + () + else + ErrorMsg.errorAt loc "Invalid string passed to 'blessMime'"; + se) | EFfiApp ("Basis", "checkString", [(EPrim (Prim.String s), loc)]) => let |