Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
38c16cdb
Commit
38c16cdb
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[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
Changes
1
Hide whitespace changes
Inline
Side-by-side
typing/typer.ml
View file @
38c16cdb
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment