summaryrefslogtreecommitdiff
path: root/bytecomp/matching.ml
diff options
context:
space:
mode:
authorJun FURUSE / 古瀬 淳 <jun.furuse@gmail.com>2004-06-18 05:04:14 +0000
committerJun FURUSE / 古瀬 淳 <jun.furuse@gmail.com>2004-06-18 05:04:14 +0000
commit5e1bf20850aaa9b1ceb86a971848609ee9e84c47 (patch)
treef3a6e5b5c38263fe527e6275ff95425f12637226 /bytecomp/matching.ml
parent8ec769214e067da9ee8b33d05f4ef275e9269dd5 (diff)
downloadocaml-gcaml.tar.gz
port to the latest ocaml (2004/06/18)gcaml
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gcaml@6419 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/matching.ml')
-rw-r--r--bytecomp/matching.ml20
1 files changed, 14 insertions, 6 deletions
diff --git a/bytecomp/matching.ml b/bytecomp/matching.ml
index 3515538bf4..5a1b19e50b 100644
--- a/bytecomp/matching.ml
+++ b/bytecomp/matching.ml
@@ -376,11 +376,11 @@ let pretty_cases cases =
prerr_string " " ;
prerr_string (Format.flush_str_formatter ()))
ps ;
-(*
+
prerr_string " -> " ;
Printlambda.lambda Format.str_formatter l ;
prerr_string (Format.flush_str_formatter ()) ;
-*)
+
prerr_endline "")
cases
@@ -778,7 +778,7 @@ let rebuild_nexts arg nexts k =
(*
Split a matching.
Splitting is first directed by or-patterns, then by
- must test (e.g. constructors)/variable transitions.
+ tests (e.g. constructors)/variable transitions.
The approach is greedy, every split function attempt to
raise rows as much as possible in the top matrix,
@@ -1778,13 +1778,21 @@ let mk_res get_key env last_choice idef cant_fail ctx =
fail, klist, jumps
-(* Aucune optimisation, reflechir apres la release *)
+(*
+ Following two ``failaction'' function compute n, the trap handler
+ to jump to in case of failure of elementary tests
+*)
+
let mk_failaction_neg partial ctx def = match partial with
| Partial ->
begin match def with
| (_,idef)::_ ->
Some (Lstaticraise (idef,[])),[],jumps_singleton idef ctx
- | _ -> assert false
+ | _ ->
+ (* Act as Total, this means
+ If no appropriate default matrix exists,
+ then this switch cannot fail *)
+ None, [], jumps_empty
end
| Total ->
None, [], jumps_empty
@@ -2284,7 +2292,7 @@ and do_compile_matching_pr repr partial ctx arg x =
prerr_string "COMPILE: " ;
prerr_endline (match partial with Partial -> "Partial" | Total -> "Total") ;
prerr_endline "MATCH" ;
- pretty_ext x ;
+ pretty_precompiled x ;
prerr_endline "CTX" ;
pretty_ctx ctx ;
let (_, jumps) as r = do_compile_matching repr partial ctx arg x in