Commit e7298595 authored by Andrei Paskevich's avatar Andrei Paskevich

Dterm, Dexpr: make the ~keep_loc argument optional

parent d1d7174d
......@@ -549,8 +549,11 @@ and try_term strict keep_loc uloc env prop dty node =
| DTcast _ | DTuloc _ | DTlabel _ ->
assert false (* already stripped *)
let fmla ~strict ~keep_loc dt = term ~strict ~keep_loc None Mstr.empty true dt
let term ~strict ~keep_loc dt = term ~strict ~keep_loc None Mstr.empty false dt
let fmla ?(strict=true) ?(keep_loc=true) dt =
term ~strict ~keep_loc None Mstr.empty true dt
let term ?(strict=true) ?(keep_loc=true) dt =
term ~strict ~keep_loc None Mstr.empty false dt
(** Exception printer *)
......
......@@ -103,6 +103,6 @@ val dterm : ?loc:Loc.position -> dterm_node -> dterm
(** Final stage *)
val term : strict:bool -> keep_loc:bool -> dterm -> term
val term : ?strict:bool -> ?keep_loc:bool -> dterm -> term
val fmla : strict:bool -> keep_loc:bool -> dterm -> term
val fmla : ?strict:bool -> ?keep_loc:bool -> dterm -> term
......@@ -1148,20 +1148,20 @@ and expr_fun ~keep_loc uloc env pvl dsp de =
let xq = create_xpost dsp.ds_xpost in
e_fun pvl p q xq e, dsp, env
let val_decl ~keep_loc:_ (id,_,_,_,_,_ as vald) =
let val_decl ?(keep_loc=true) (id,_,_,_,_,_ as vald) =
reunify_regions ();
Loc.try2 ?loc:id.pre_loc val_decl env_empty vald
let rec_defn ~keep_loc drdf =
let rec_defn ?(keep_loc=true) drdf =
reunify_regions ();
expr_rec ~keep_loc None env_empty drdf
let expr ~keep_loc de =
let expr ?(keep_loc=true) de =
reunify_regions ();
let e = expr ~keep_loc None env_empty false de in
check_expr e; e
let let_defn ~keep_loc (id,ghost,kind,de) =
let let_defn ?(keep_loc=true) (id,ghost,kind,de) =
let e = expr ~keep_loc de in
if e.e_ghost && not ghost then Loc.errorm ?loc:id.pre_loc
"%s %s must be explicitly marked ghost" (match kind, e.e_vty with
......
......@@ -157,8 +157,8 @@ val drec_defn : denv -> pre_fun_defn list -> denv * drec_defn
(** Final stage *)
val expr : keep_loc:bool -> dexpr -> expr
val expr : ?keep_loc:bool -> dexpr -> expr
val val_decl : keep_loc:bool -> dval_decl -> val_decl
val let_defn : keep_loc:bool -> dlet_defn -> let_defn
val rec_defn : keep_loc:bool -> drec_defn -> rec_defn
val val_decl : ?keep_loc:bool -> dval_decl -> val_decl
val let_defn : ?keep_loc:bool -> dlet_defn -> let_defn
val rec_defn : ?keep_loc:bool -> drec_defn -> rec_defn
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment