diff 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
line wrap: on
line diff
--- a/src/compiler.sml	Sun Jul 29 12:54:17 2012 -0400
+++ b/src/compiler.sml	Thu Aug 02 16:33:25 2012 -0400
@@ -58,6 +58,7 @@
      filterMime : Settings.rule list,
      filterRequest : Settings.rule list,
      filterResponse : Settings.rule list,
+     filterEnv : Settings.rule list,
      protocol : string option,
      dbms : string option,
      sigFile : string option,
@@ -365,6 +366,7 @@
      Settings.setMimeRules (#filterMime job);
      Settings.setRequestHeaderRules (#filterRequest job);
      Settings.setResponseHeaderRules (#filterResponse job);
+     Settings.setEnvVarRules (#filterEnv job);
      Option.app Settings.setProtocol (#protocol job);
      Option.app Settings.setDbms (#dbms job);
      Settings.setSafeGets (#safeGets job);
@@ -439,6 +441,7 @@
                         filterMime = [],
                         filterRequest = [],
                         filterResponse = [],
+                        filterEnv = [],
                         protocol = NONE,
                         dbms = NONE,
                         sigFile = NONE,
@@ -557,6 +560,7 @@
                      val mime = ref []
                      val request = ref []
                      val response = ref []
+                     val env = ref []
                      val libs = ref []
                      val protocol = ref NONE
                      val dbms = ref NONE
@@ -592,6 +596,7 @@
                                  filterMime = rev (!mime),
                                  filterRequest = rev (!request),
                                  filterResponse = rev (!response),
+                                 filterEnv = rev (!env),
                                  sources = sources,
                                  protocol = !protocol,
                                  dbms = !dbms,
@@ -648,6 +653,7 @@
                                  filterMime = #filterMime old @ #filterMime new,
                                  filterRequest = #filterRequest old @ #filterRequest new,
                                  filterResponse = #filterResponse old @ #filterResponse new,
+                                 filterEnv = #filterEnv old @ #filterEnv new,
                                  sources = #sources new
                                            @ List.filter (fn s => List.all (fn s' => s' <> s) (#sources new))
                                                          (#sources old),
@@ -690,6 +696,7 @@
                            | "mime" => mime
                            | "requestHeader" => request
                            | "responseHeader" => response
+                           | "env" => env
                            | _ => (ErrorMsg.error "Bad filter kind";
                                    url)