summaryrefslogtreecommitdiff
path: root/lex
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2014-08-22 13:45:02 +0000
committerDamien Doligez <damien.doligez-inria.fr>2014-08-22 13:45:02 +0000
commitcbfe627f925ab2bab93bae7a7bc9f6ee6afb8637 (patch)
treeaf5ec283ac3175b1ab95dd745dbd05f2298b9da6 /lex
parent09ad9c1abbe6bee443a55379223280dab3de4749 (diff)
downloadocaml-cbfe627f925ab2bab93bae7a7bc9f6ee6afb8637.tar.gz
merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'lex')
-rw-r--r--lex/compact.ml28
-rw-r--r--lex/cset.ml2
-rw-r--r--lex/lexgen.ml6
-rw-r--r--lex/output.ml2
-rw-r--r--lex/outputbis.ml2
-rw-r--r--lex/table.ml4
6 files changed, 22 insertions, 22 deletions
diff --git a/lex/compact.ml b/lex/compact.ml
index 1f620ab8df..f468a557d6 100644
--- a/lex/compact.ml
+++ b/lex/compact.ml
@@ -92,13 +92,13 @@ type t_compact =
mutable c_last_used : int ; }
let create_compact () =
- { c_trans = Array.create 1024 0 ;
- c_check = Array.create 1024 (-1) ;
+ { c_trans = Array.make 1024 0 ;
+ c_check = Array.make 1024 (-1) ;
c_last_used = 0 ; }
let reset_compact c =
- c.c_trans <- Array.create 1024 0 ;
- c.c_check <- Array.create 1024 (-1) ;
+ c.c_trans <- Array.make 1024 0 ;
+ c.c_check <- Array.make 1024 (-1) ;
c.c_last_used <- 0
(* One compacted table for transitions, one other for memory actions *)
@@ -110,9 +110,9 @@ let grow_compact c =
let old_trans = c.c_trans
and old_check = c.c_check in
let n = Array.length old_trans in
- c.c_trans <- Array.create (2*n) 0;
+ c.c_trans <- Array.make (2*n) 0;
Array.blit old_trans 0 c.c_trans 0 c.c_last_used;
- c.c_check <- Array.create (2*n) (-1);
+ c.c_check <- Array.make (2*n) (-1);
Array.blit old_check 0 c.c_check 0 c.c_last_used
let do_pack state_num orig compact =
@@ -142,8 +142,8 @@ let do_pack state_num orig compact =
(base, default)
let pack_moves state_num move_t =
- let move_v = Array.create 257 0
- and move_m = Array.create 257 0 in
+ let move_v = Array.make 257 0
+ and move_m = Array.make 257 0 in
for i = 0 to 256 do
let act,c = move_t.(i) in
move_v.(i) <- (match act with Backtrack -> -1 | Goto n -> n) ;
@@ -175,12 +175,12 @@ type lex_tables =
let compact_tables state_v =
let n = Array.length state_v in
- let base = Array.create n 0
- and backtrk = Array.create n (-1)
- and default = Array.create n 0
- and base_code = Array.create n 0
- and backtrk_code = Array.create n 0
- and default_code = Array.create n 0 in
+ let base = Array.make n 0
+ and backtrk = Array.make n (-1)
+ and default = Array.make n 0
+ and base_code = Array.make n 0
+ and backtrk_code = Array.make n 0
+ and default_code = Array.make n 0 in
for i = 0 to n - 1 do
match state_v.(i) with
| Perform (n,c) ->
diff --git a/lex/cset.ml b/lex/cset.ml
index 8c3d176fa5..f4581ba374 100644
--- a/lex/cset.ml
+++ b/lex/cset.ml
@@ -81,7 +81,7 @@ let complement s = diff all_chars s
let env_to_array env = match env with
| [] -> assert false
| (_,x)::rem ->
- let res = Array.create 257 x in
+ let res = Array.make 257 x in
List.iter
(fun (c,y) ->
List.iter
diff --git a/lex/lexgen.ml b/lex/lexgen.ml
index 035e3fe6c0..503b08fa49 100644
--- a/lex/lexgen.ml
+++ b/lex/lexgen.ml
@@ -589,7 +589,7 @@ let rec firstpos = function
(* Berry-sethi followpos *)
let followpos size entry_list =
- let v = Array.create size TransSet.empty in
+ let v = Array.make size TransSet.empty in
let rec fill s = function
| Empty|Action _|Tag _ -> ()
| Chars (n,_) -> v.(n) <- s
@@ -1132,7 +1132,7 @@ let make_tag_entry id start act a r = match a with
| _ -> r
let extract_tags l =
- let envs = Array.create (List.length l) TagMap.empty in
+ let envs = Array.make (List.length l) TagMap.empty in
List.iter
(fun (act,m,_) ->
envs.(act) <-
@@ -1186,7 +1186,7 @@ let make_dfa lexdef =
done ;
eprintf "%d states\n" !next_state_num ;
*)
- let actions = Array.create !next_state_num (Perform (0,[])) in
+ let actions = Array.make !next_state_num (Perform (0,[])) in
List.iter (fun (act, i) -> actions.(i) <- act) states;
(* Useless state reset, so as to restrict GC roots *)
reset_state () ;
diff --git a/lex/output.ml b/lex/output.ml
index 2e7700257c..638260c2b4 100644
--- a/lex/output.ml
+++ b/lex/output.ml
@@ -77,7 +77,7 @@ let output_entry sourcefile ic oc has_refill oci e =
output_args e.auto_args
(fun oc x ->
if x > 0 then
- fprintf oc "lexbuf.Lexing.lex_mem <- Array.create %d (-1) ; " x)
+ fprintf oc "lexbuf.Lexing.lex_mem <- Array.make %d (-1) ; " x)
e.auto_mem_size
(output_memory_actions " ") init_moves
e.auto_name
diff --git a/lex/outputbis.ml b/lex/outputbis.ml
index 333cbc2a22..709ec0eec8 100644
--- a/lex/outputbis.ml
+++ b/lex/outputbis.ml
@@ -20,7 +20,7 @@ let output_auto_defs oc has_refill =
output_string oc
"let __ocaml_lex_init_lexbuf lexbuf mem_size =\
\n let pos = lexbuf.Lexing.lex_curr_pos in\
-\n lexbuf.Lexing.lex_mem <- Array.create mem_size (-1) ;\
+\n lexbuf.Lexing.lex_mem <- Array.make mem_size (-1) ;\
\n lexbuf.Lexing.lex_start_pos <- pos ;\
\n lexbuf.Lexing.lex_last_pos <- pos ;\
\n lexbuf.Lexing.lex_last_action <- -1\
diff --git a/lex/table.ml b/lex/table.ml
index fb5a6128eb..715d90758d 100644
--- a/lex/table.ml
+++ b/lex/table.ml
@@ -15,12 +15,12 @@ type 'a t = {mutable next : int ; mutable data : 'a array}
let default_size = 32
;;
-let create x = {next = 0 ; data = Array.create default_size x}
+let create x = {next = 0 ; data = Array.make default_size x}
and reset t = t.next <- 0
;;
let incr_table table new_size =
- let t = Array.create new_size table.data.(0) in
+ let t = Array.make new_size table.data.(0) in
Array.blit table.data 0 t 0 (Array.length table.data) ;
table.data <- t