diff options
| author | Damien Doligez <damien.doligez-inria.fr> | 2014-03-31 17:58:53 +0000 |
|---|---|---|
| committer | Damien Doligez <damien.doligez-inria.fr> | 2014-03-31 17:58:53 +0000 |
| commit | 8643356b8542e0dcab358716f1e04d47b08b1a6d (patch) | |
| tree | e10cc5a03f7ead69a2d4ed563cbd021df5770ef2 /bytecomp/bytegen.ml | |
| parent | cd1bf4b9fc898cee2f4886ed18ddf6271ec522e8 (diff) | |
| parent | 989ac0b2635443b9c0f183ee6343b663c854f4ea (diff) | |
| download | ocaml-ephemeron.tar.gz | |
merge with trunk at rev 14512ephemeron
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ephemeron@14514 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/bytegen.ml')
| -rw-r--r-- | bytecomp/bytegen.ml | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bytecomp/bytegen.ml b/bytecomp/bytegen.ml index 6ecd41dde1..3b25c3db3b 100644 --- a/bytecomp/bytegen.ml +++ b/bytecomp/bytegen.ml @@ -275,6 +275,10 @@ let compunit_name = ref "" let max_stack_used = ref 0 + +(* Sequence of string tests *) + + (* Translate a primitive to a bytecode instruction (possibly a call to a C function) *) @@ -618,7 +622,7 @@ let rec comp_expr env exp sz cont = comp_args env args sz (comp_primitive p args :: cont) | Lprim(p, args) -> comp_args env args sz (comp_primitive p args :: cont) - | Lstaticcatch (body, (i, vars) , handler) -> + | Lstaticcatch (body, (i, vars) , handler) -> let nvars = List.length vars in let branch1, cont1 = make_branch cont in let r = @@ -703,7 +707,6 @@ let rec comp_expr env exp sz cont = (fun (n, act) -> act_consts.(n) <- store.act_store act) sw.sw_consts; List.iter (fun (n, act) -> act_blocks.(n) <- store.act_store act) sw.sw_blocks; - (* Compile and label actions *) let acts = store.act_get () in let lbls = Array.create (Array.length acts) 0 in @@ -723,6 +726,8 @@ let rec comp_expr env exp sz cont = lbl_consts.(i) <- lbls.(act_consts.(i)) done; comp_expr env arg sz (Kswitch(lbl_consts, lbl_blocks) :: !c) + | Lstringswitch (arg,sw,d) -> + comp_expr env (Matching.expand_stringswitch arg sw d) sz cont | Lassign(id, expr) -> begin try let pos = Ident.find_same id env.ce_stack in @@ -827,6 +832,10 @@ and comp_binary_test env cond ifso ifnot sz cont = comp_expr env cond sz cont_cond +(* Compile string switch *) + +and comp_string_switch env arg cases default sz cont = () + (**** Compilation of a code block (with tracking of stack usage) ****) let comp_block env exp sz cont = |
