X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/492c1cff68a2da969a559627725369c211470c92..6be996d467429cc09f81becd3fd4e294ae1871ae:/src/env.sml?ds=sidebyside diff --git a/src/env.sml b/src/env.sml index b52ead1..d18a5a9 100644 --- a/src/env.sml +++ b/src/env.sml @@ -25,6 +25,10 @@ open Ast structure SS = StringSet structure SM = StringMap +val typeRules : (exp -> bool) SM.map ref = ref SM.empty +fun registerType (name, rule) = typeRules := SM.insert (!typeRules, name, rule) +fun typeRule name = SM.find (!typeRules, name) + type env = SS.set * (typ * exp option) SM.map val empty : env = (SS.add (SS.singleton "int", "string"), SM.empty)