Add external functions called during reduction
[hcoop/domtool2.git] / src / env.sml
index 1a93a38..f87278f 100644 (file)
@@ -41,6 +41,11 @@ fun registerContainer (name, befor, after) =
     containers := SM.insert (!containers, name, (befor, after))
 fun container name = SM.find (!containers, name)
 
+val functions : (exp list -> exp option) SM.map ref = ref SM.empty
+fun registerFunction (name, f) =
+    functions := SM.insert (!functions, name, f)
+fun function name = SM.find (!functions, name)
+
 local
     val pr = ref (fn () => ())
 in