URL handling
[hcoop/domtool2.git] / src / domain.sml
index aa392bc..71d448d 100644 (file)
@@ -71,6 +71,13 @@ fun yourPath path =
                                     orelse ch = #"-" orelse ch = #"_") path
     andalso SS.exists (fn s' => path = s' orelse String.isPrefix (s' ^ "/") path) (your_paths ())
 
+val _ = Env.type_one "no_spaces"
+                    Env.string
+                    (CharVector.all (fn ch => not (Char.isSpace ch)))
+val _ = Env.type_one "no_newlines"
+                    Env.string
+                    (CharVector.all (fn ch => ch <> #"\n" andalso ch <> #"\r"))
+
 val _ = Env.type_one "ip"
        Env.string
        validIp