diff src/mono_opt.sml @ 1799:3d922a28370b

Basis.getenv
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Aug 2012 16:33:25 -0400
parents e8c668e518fb
children 93ff76058825
line wrap: on
line diff
--- a/src/mono_opt.sml	Sun Jul 29 12:54:17 2012 -0400
+++ b/src/mono_opt.sml	Thu Aug 02 16:33:25 2012 -0400
@@ -504,6 +504,17 @@
              ESome ((TFfi ("Basis", "string"), loc), (se, loc))
          else
              ENone (TFfi ("Basis", "string"), loc))
+      | EFfiApp ("Basis", "blessEnvVar", [((se as EPrim (Prim.String s), loc), _)]) =>
+        (if Settings.checkEnvVar s then
+             ()
+         else
+             ErrorMsg.errorAt loc ("Invalid string " ^ s ^ " passed to 'blessEnvVar'");
+         se)
+      | EFfiApp ("Basis", "checkEnvVar", [((se as EPrim (Prim.String s), loc), _)]) =>
+        (if Settings.checkEnvVar s then
+             ESome ((TFfi ("Basis", "string"), loc), (se, loc))
+         else
+             ENone (TFfi ("Basis", "string"), loc))
 
       | EFfiApp ("Basis", "checkString", [((EPrim (Prim.String s), loc), _)]) => 
         let