Mercurial > urweb
comparison src/mono_opt.sml @ 769:efceae06df17
allow/deny working in Mono_opt
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 02 May 2009 13:37:52 -0400 |
parents | 8688e01ae469 |
children | 493f44759879 |
comparison
equal
deleted
inserted
replaced
768:3b7e46790fa7 | 769:efceae06df17 |
---|---|
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 val blessMime = ref (CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"-" orelse ch = #"/" orelse ch = #".")) | |
35 | |
36 fun typ t = t | 33 fun typ t = t |
37 fun decl d = d | 34 fun decl d = d |
38 | 35 |
39 fun attrifyInt n = | 36 fun attrifyInt n = |
40 if n < 0 then | 37 if n < 0 then |
380 optExp (EApp (e2, e1), loc) | 377 optExp (EApp (e2, e1), loc) |
381 | 378 |
382 | EJavaScript (_, _, SOME (e, _)) => e | 379 | EJavaScript (_, _, SOME (e, _)) => e |
383 | 380 |
384 | EFfiApp ("Basis", "bless", [(se as EPrim (Prim.String s), loc)]) => | 381 | EFfiApp ("Basis", "bless", [(se as EPrim (Prim.String s), loc)]) => |
385 (if !bless s then | 382 (if Settings.checkUrl s then |
386 () | 383 () |
387 else | 384 else |
388 ErrorMsg.errorAt loc "Invalid URL passed to 'bless'"; | 385 ErrorMsg.errorAt loc ("Invalid URL " ^ s ^ " passed to 'bless'"); |
389 se) | 386 se) |
390 | EFfiApp ("Basis", "blessMime", [(se as EPrim (Prim.String s), loc)]) => | 387 | EFfiApp ("Basis", "blessMime", [(se as EPrim (Prim.String s), loc)]) => |
391 (if !blessMime s then | 388 (if Settings.checkMime s then |
392 () | 389 () |
393 else | 390 else |
394 ErrorMsg.errorAt loc "Invalid string passed to 'blessMime'"; | 391 ErrorMsg.errorAt loc ("Invalid string " ^ s ^ " passed to 'blessMime'"); |
395 se) | 392 se) |
396 | 393 |
397 | EFfiApp ("Basis", "checkString", [(EPrim (Prim.String s), loc)]) => | 394 | EFfiApp ("Basis", "checkString", [(EPrim (Prim.String s), loc)]) => |
398 let | 395 let |
399 fun uwify (cs, acc) = | 396 fun uwify (cs, acc) = |