Commit 38c16cdb authored by Pietro Abate's avatar Pietro Abate

[r2005-06-13 09:58:18 by afrisch] Unused branches in select..from..where

Original author: afrisch
Date: 2005-06-13 09:58:18+00:00
parent 96fd2a52
......@@ -713,20 +713,24 @@ and select_from_where env loc e from where =
(* if cond then ... else [] *)
let rest = List.fold_left put_cond rest here in
(* transform e with p -> ... *)
let b = {
Typed.br_typ = Types.empty;
Typed.br_branches = [
{ Typed.br_loc = ploc;
let br = { Typed.br_loc = ploc;
Typed.br_used = false;
Typed.br_vars_empty = fvp;
Typed.br_pat = p;
Typed.br_body = rest } ];
Typed.br_body = rest } in
cur_branch := [ Branch (br, !cur_branch) ];
let b = {
Typed.br_typ = Types.empty;
Typed.br_branches = [ br ];
Typed.br_accept = Types.descr (Patterns.accept p);
} in
let br_loc = merge_loc ploc e.Typed.exp_loc in
(above,exp' br_loc (Typed.Transform (e, b)))
in
let cur_br = !cur_branch in
cur_branch := [];
let (fv,e) = expr !env noloc (Pair(e,cst_nil)) in
cur_branch := !cur_branch @ cur_br;
let (where,rest) = List.fold_right aux from (where,e) in
(* The remaining conditions are constant. Gives a warning for that. *)
(match where with
......
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