From fdc6c1310be60fbeb597400618473861f78676de Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 2 Aug 2012 16:33:25 -0400 Subject: Basis.getenv --- src/mono_opt.sml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mono_opt.sml') diff --git a/src/mono_opt.sml b/src/mono_opt.sml index 70404c09..228c53e6 100644 --- a/src/mono_opt.sml +++ b/src/mono_opt.sml @@ -504,6 +504,17 @@ fun exp e = 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 -- cgit v1.2.3