X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/dac62e84b324d2187ec9b9882efa47125d5599a4..12adf55a902b1d9bde677e4636530e5753857e05:/src/env.sig diff --git a/src/env.sig b/src/env.sig index d239e14..e5f19e6 100644 --- a/src/env.sig +++ b/src/env.sig @@ -32,16 +32,62 @@ signature ENV = sig val registerContainer : string * action * (unit -> unit) -> unit val container : string -> (action * (unit -> unit)) option - val badArgs : string -> 'a + (* Actions to take before and after evaluating a file *) + val registerPre : (unit -> unit) -> unit + val pre : unit -> unit + val registerPost : (unit -> unit) -> unit + val post : unit -> unit + + (* ...and before type-checking *) + val registerPreTycheck : (unit -> unit) -> unit + val preTycheck : unit -> unit + + val badArgs : string * Ast.exp list -> 'a + val badArg : string * string * Ast.exp -> 'a + + type 'a arg = Ast.exp -> 'a option + + val int : int arg + val string : string arg + val list : 'a arg -> 'a list arg + + val none : string -> (unit -> unit) -> action + val one : string -> string * 'a arg -> ('a -> unit) -> action + val two : string -> string * 'a arg * string * 'b arg -> ('a * 'b -> unit) -> action + + val oneV : string -> string * 'a arg -> (env_vars * 'a -> unit) -> action + val twoV : string -> string * 'a arg * string * 'b arg -> (env_vars * 'a * 'b -> unit) -> action + + val env : 'a arg -> env_vars * string -> 'a + + val type_one : string -> 'a arg -> ('a -> bool) -> unit + + val action_none : string -> (unit -> unit) -> unit + val action_one : string -> string * 'a arg -> ('a -> unit) -> unit + val action_two : string -> string * 'a arg * string * 'b arg -> ('a * 'b -> unit) -> unit + + val actionV_none : string -> (env_vars -> unit) -> unit + val actionV_one : string -> string * 'a arg -> (env_vars * 'a -> unit) -> unit + val actionV_two : string -> string * 'a arg * string * 'b arg -> (env_vars * 'a * 'b -> unit) -> unit + + val container_none : string -> (unit -> unit) * (unit -> unit) -> unit + val container_one : string -> string * 'a arg -> ('a -> unit) * (unit -> unit) -> unit + + val containerV_one : string -> string * 'a arg -> (env_vars * 'a -> unit) * (unit -> unit) -> unit type env val empty : env val bindType : env -> string -> env val bindVal : env -> string * Ast.typ * Ast.exp option -> env + val bindContext : env -> string -> env val lookupType : env -> string -> bool val lookupVal : env -> string -> Ast.typ option val lookupEquation : env -> string -> Ast.exp option + val lookupContext : env -> string -> bool + val types : env -> Ast.StringSet.set + val vals : env -> Ast.StringSet.set + val contexts : env -> Ast.StringSet.set end