X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=pa_goal.ml;h=13ea23c81ced03b1de612dca10794531ce4b7908;hb=087ea609510e7c85e1048219f4aa96348d1eaeda;hp=e7952336b35f3aee1cc0db809aa09ad67165e1f7;hpb=aa32ee4513449868d5c47a31df66a9ffabd26cba;p=goaljobs.git diff --git a/pa_goal.ml b/pa_goal.ml index e795233..13ea23c 100644 --- a/pa_goal.ml +++ b/pa_goal.ml @@ -68,6 +68,9 @@ let generate_let_goal _loc (r : rec_flag) (lets : binding) = (* Rename the function to goal_. *) let gname = "goal_" ^ name in + (* Convert loc to string for goalloc. *) + let goalloc = Loc.to_string _loc in + (* Split the function into parameters and body. *) let params, body = function_parameters expr in @@ -87,6 +90,10 @@ let generate_let_goal _loc (r : rec_flag) (lets : binding) = let body = <:expr< (* Define a goal name which the body may use. *) let goalname = $str:name$ in + + (* Source location. *) + let goalloc = $str:goalloc$ in + (* Define onsuccess, onrun, onfail functions that the body may call. *) let _on, _call_on = let _on fns f = fns := f :: !fns in @@ -109,7 +116,7 @@ let generate_let_goal _loc (r : rec_flag) (lets : binding) = _call_onsuccesses (); (* Avoid a compiler warning: *) - ignore (goalname) + ignore (goalname); ignore (goalloc) with (* target() within the body may raise Goal_OK meaning that the * goal should be short-circuited. We return as if it's an