Refactor state into a separate [Whenstate] module.
[whenjobs.git] / lib / whenfile.mli
index b754cbc..54ee52d 100644 (file)
 
 (** This module is used when compiling whenjobs input files. *)
 
-val init : unit -> unit
-(** "Initialize" the module.  Clear the list of jobs and other
-    internal variables so we are ready to parse a new file. *)
+val init : Whenstate.t -> unit
+(** "Initialize" the module.  Pass in the initial state, ready for
+    parsing a new file. *)
 
-val get_jobs : unit -> Whenexpr.job list
-(** Get the jobs added since {!init} was called. *)
+val get_state : unit -> Whenstate.t
+(** Return the updated state.  Call this after parsing the file. *)
 
 val add_when_job : Camlp4.PreCast.Loc.t -> string -> Camlp4.PreCast.Ast.expr -> Whenexpr.shell_script -> unit
 (** When a 'when' macro appears as a toplevel statement in an