Commit 0c5127b2 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2002-10-21 21:21:42 by cvscast] Empty log message

Original author: cvscast
Date: 2002-10-21 21:21:42+00:00
parent 57f3390a
...@@ -507,6 +507,19 @@ and type_check' loc env e constr precise = match e with ...@@ -507,6 +507,19 @@ and type_check' loc env e constr precise = match e with
let res = Sequence.concat t1 t2 in let res = Sequence.concat t1 t2 in
check loc res constr ""; check loc res constr "";
if precise then res else constr if precise then res else constr
| Op ("flatten", [e]) ->
let constr' = Sequence.star
(Sequence.approx (Types.cap Sequence.any constr)) in
let sconstr' = Sequence.star constr' in
let exact = Types.subtype constr' constr in
if exact then
let t = type_check env e sconstr' precise in
if precise then Sequence.flatten t else constr
else
let t = type_check env e sconstr' true in
let res = Sequence.flatten t in
check loc res constr "";
if precise then res else constr
| _ -> | _ ->
let t : Types.descr = compute_type' loc env e in let t : Types.descr = compute_type' loc env e in
check loc t constr ""; check loc t constr "";
......
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