comparison src/compiler.sml @ 1799:3d922a28370b

Basis.getenv
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Aug 2012 16:33:25 -0400
parents 85a87f155e7b
children 38297294cf98
comparison
equal deleted inserted replaced
1798:10a2cb93d175 1799:3d922a28370b
56 rewrites : Settings.rewrite list, 56 rewrites : Settings.rewrite list,
57 filterUrl : Settings.rule list, 57 filterUrl : Settings.rule list,
58 filterMime : Settings.rule list, 58 filterMime : Settings.rule list,
59 filterRequest : Settings.rule list, 59 filterRequest : Settings.rule list,
60 filterResponse : Settings.rule list, 60 filterResponse : Settings.rule list,
61 filterEnv : Settings.rule list,
61 protocol : string option, 62 protocol : string option,
62 dbms : string option, 63 dbms : string option,
63 sigFile : string option, 64 sigFile : string option,
64 safeGets : string list, 65 safeGets : string list,
65 onError : (string * string list * string) option, 66 onError : (string * string list * string) option,
363 Settings.setRewriteRules (#rewrites job); 364 Settings.setRewriteRules (#rewrites job);
364 Settings.setUrlRules (#filterUrl job); 365 Settings.setUrlRules (#filterUrl job);
365 Settings.setMimeRules (#filterMime job); 366 Settings.setMimeRules (#filterMime job);
366 Settings.setRequestHeaderRules (#filterRequest job); 367 Settings.setRequestHeaderRules (#filterRequest job);
367 Settings.setResponseHeaderRules (#filterResponse job); 368 Settings.setResponseHeaderRules (#filterResponse job);
369 Settings.setEnvVarRules (#filterEnv job);
368 Option.app Settings.setProtocol (#protocol job); 370 Option.app Settings.setProtocol (#protocol job);
369 Option.app Settings.setDbms (#dbms job); 371 Option.app Settings.setDbms (#dbms job);
370 Settings.setSafeGets (#safeGets job); 372 Settings.setSafeGets (#safeGets job);
371 Settings.setOnError (#onError job); 373 Settings.setOnError (#onError job);
372 Settings.setMinHeap (#minHeap job); 374 Settings.setMinHeap (#minHeap job);
437 hyphenate = false}], 439 hyphenate = false}],
438 filterUrl = [], 440 filterUrl = [],
439 filterMime = [], 441 filterMime = [],
440 filterRequest = [], 442 filterRequest = [],
441 filterResponse = [], 443 filterResponse = [],
444 filterEnv = [],
442 protocol = NONE, 445 protocol = NONE,
443 dbms = NONE, 446 dbms = NONE,
444 sigFile = NONE, 447 sigFile = NONE,
445 safeGets = [], 448 safeGets = [],
446 onError = NONE, 449 onError = NONE,
555 val rewrites = ref [] 558 val rewrites = ref []
556 val url = ref [] 559 val url = ref []
557 val mime = ref [] 560 val mime = ref []
558 val request = ref [] 561 val request = ref []
559 val response = ref [] 562 val response = ref []
563 val env = ref []
560 val libs = ref [] 564 val libs = ref []
561 val protocol = ref NONE 565 val protocol = ref NONE
562 val dbms = ref NONE 566 val dbms = ref NONE
563 val sigFile = ref (Settings.getSigFile ()) 567 val sigFile = ref (Settings.getSigFile ())
564 val safeGets = ref [] 568 val safeGets = ref []
590 rewrites = rev (!rewrites), 594 rewrites = rev (!rewrites),
591 filterUrl = rev (!url), 595 filterUrl = rev (!url),
592 filterMime = rev (!mime), 596 filterMime = rev (!mime),
593 filterRequest = rev (!request), 597 filterRequest = rev (!request),
594 filterResponse = rev (!response), 598 filterResponse = rev (!response),
599 filterEnv = rev (!env),
595 sources = sources, 600 sources = sources,
596 protocol = !protocol, 601 protocol = !protocol,
597 dbms = !dbms, 602 dbms = !dbms,
598 sigFile = !sigFile, 603 sigFile = !sigFile,
599 safeGets = rev (!safeGets), 604 safeGets = rev (!safeGets),
646 rewrites = #rewrites old @ #rewrites new, 651 rewrites = #rewrites old @ #rewrites new,
647 filterUrl = #filterUrl old @ #filterUrl new, 652 filterUrl = #filterUrl old @ #filterUrl new,
648 filterMime = #filterMime old @ #filterMime new, 653 filterMime = #filterMime old @ #filterMime new,
649 filterRequest = #filterRequest old @ #filterRequest new, 654 filterRequest = #filterRequest old @ #filterRequest new,
650 filterResponse = #filterResponse old @ #filterResponse new, 655 filterResponse = #filterResponse old @ #filterResponse new,
656 filterEnv = #filterEnv old @ #filterEnv new,
651 sources = #sources new 657 sources = #sources new
652 @ List.filter (fn s => List.all (fn s' => s' <> s) (#sources new)) 658 @ List.filter (fn s => List.all (fn s' => s' <> s) (#sources new))
653 (#sources old), 659 (#sources old),
654 protocol = mergeO #2 (#protocol old, #protocol new), 660 protocol = mergeO #2 (#protocol old, #protocol new),
655 dbms = mergeO #2 (#dbms old, #dbms new), 661 dbms = mergeO #2 (#dbms old, #dbms new),
688 case s of 694 case s of
689 "url" => url 695 "url" => url
690 | "mime" => mime 696 | "mime" => mime
691 | "requestHeader" => request 697 | "requestHeader" => request
692 | "responseHeader" => response 698 | "responseHeader" => response
699 | "env" => env
693 | _ => (ErrorMsg.error "Bad filter kind"; 700 | _ => (ErrorMsg.error "Bad filter kind";
694 url) 701 url)
695 702
696 fun parsePattern s = 703 fun parsePattern s =
697 if size s > 0 andalso String.sub (s, size s - 1) = #"*" then 704 if size s > 0 andalso String.sub (s, size s - 1) = #"*" then