Commit bef064c7 authored by POTTIER Francois's avatar POTTIER Francois

Changed [Array.create] to [Array.make] everywhere.

parent cf27e30a
...@@ -691,10 +691,10 @@ end ...@@ -691,10 +691,10 @@ end
The forward reference graph is unused but can be printed on demand. *) The forward reference graph is unused but can be printed on demand. *)
let forward : NonterminalSet.t array = let forward : NonterminalSet.t array =
Array.create Nonterminal.n NonterminalSet.empty Array.make Nonterminal.n NonterminalSet.empty
let backward : NonterminalSet.t array = let backward : NonterminalSet.t array =
Array.create Nonterminal.n NonterminalSet.empty Array.make Nonterminal.n NonterminalSet.empty
let () = let () =
Array.iter (fun (nt1, rhs) -> Array.iter (fun (nt1, rhs) ->
...@@ -881,10 +881,10 @@ let follow : TerminalSet.t array Lazy.t = ...@@ -881,10 +881,10 @@ let follow : TerminalSet.t array Lazy.t =
Array.make Nonterminal.n TerminalSet.empty Array.make Nonterminal.n TerminalSet.empty
and forward : NonterminalSet.t array = and forward : NonterminalSet.t array =
Array.create Nonterminal.n NonterminalSet.empty Array.make Nonterminal.n NonterminalSet.empty
and backward : NonterminalSet.t array = and backward : NonterminalSet.t array =
Array.create Nonterminal.n NonterminalSet.empty Array.make Nonterminal.n NonterminalSet.empty
in in
......
...@@ -29,7 +29,7 @@ module C = Conflict (* artificial dependency; ensures that [Conflict] runs first ...@@ -29,7 +29,7 @@ module C = Conflict (* artificial dependency; ensures that [Conflict] runs first
let stack_symbols : Lr0.node -> Symbol.t array = let stack_symbols : Lr0.node -> Symbol.t array =
let dummy = let dummy =
Array.create 0 (Symbol.T Terminal.sharp) Array.make 0 (Symbol.T Terminal.sharp)
in in
Misc.tabulate Lr0.n (fun node -> Misc.tabulate Lr0.n (fun node ->
Item.Set.fold (fun item accu -> Item.Set.fold (fun item accu ->
......
...@@ -142,7 +142,7 @@ module Closure (L : Lookahead.S) = struct ...@@ -142,7 +142,7 @@ module Closure (L : Lookahead.S) = struct
ref 0 ref 0
let mapping : node array array = let mapping : node array array =
Array.create Production.n [||] Array.make Production.n [||]
let item2node item = let item2node item =
let prod, pos = export item in let prod, pos = export item in
......
...@@ -173,7 +173,7 @@ let rec explore (state : Item.Set.t) : node = ...@@ -173,7 +173,7 @@ let rec explore (state : Item.Set.t) : node =
InfiniteArray.set _transitions k (SymbolMap.map (fun symbolic_state -> InfiniteArray.set _transitions k (SymbolMap.map (fun symbolic_state ->
let (k : node) = explore (Item.Map.domain symbolic_state) in let (k : node) = explore (Item.Map.domain symbolic_state) in
let lookahead : SymbolicLookahead.t array = let lookahead : SymbolicLookahead.t array =
Array.create (Item.Map.cardinal symbolic_state) SymbolicLookahead.empty in Array.make (Item.Map.cardinal symbolic_state) SymbolicLookahead.empty in
let (_ : int) = Item.Map.fold (fun _ s i -> let (_ : int) = Item.Map.fold (fun _ s i ->
lookahead.(i) <- s; lookahead.(i) <- s;
i+1 i+1
......
...@@ -227,7 +227,7 @@ let queue : node Queue.t = ...@@ -227,7 +227,7 @@ let queue : node Queue.t =
newly found state. *) newly found state. *)
let map : node list array = let map : node list array =
Array.create Lr0.n [] Array.make Lr0.n []
(* A counter that allows assigning raw numbers to nodes. *) (* A counter that allows assigning raw numbers to nodes. *)
......
...@@ -60,7 +60,7 @@ end) = struct ...@@ -60,7 +60,7 @@ end) = struct
(* Mapping of LR(0) state numbers to lists of nodes. *) (* Mapping of LR(0) state numbers to lists of nodes. *)
let map : node list array = let map : node list array =
Array.create Lr0.n [] Array.make Lr0.n []
(* Exploring a state. This creates a new node, if necessary, and (* Exploring a state. This creates a new node, if necessary, and
enqueues it for further exploration. *) enqueues it for further exploration. *)
......
...@@ -37,7 +37,7 @@ let tabulateb n f = ...@@ -37,7 +37,7 @@ let tabulateb n f =
) 0 a ) 0 a
let tabulatef number fold n dummy f = let tabulatef number fold n dummy f =
let a = Array.create n dummy in let a = Array.make n dummy in
let () = fold (fun () element -> let () = fold (fun () element ->
a.(number element) <- f element a.(number element) <- f element
) () in ) () in
...@@ -105,7 +105,7 @@ let separated_list_to_string printer separator list = ...@@ -105,7 +105,7 @@ let separated_list_to_string printer separator list =
let index_map string_map = let index_map string_map =
let n = StringMap.cardinal string_map in let n = StringMap.cardinal string_map in
let a = Array.create n None in let a = Array.make n None in
let conv, _ = StringMap.fold let conv, _ = StringMap.fold
(fun k v (conv, idx) -> (fun k v (conv, idx) ->
a.(idx) <- Some (k, v); a.(idx) <- Some (k, v);
......
...@@ -330,7 +330,7 @@ let check_grammar p_grammar = ...@@ -330,7 +330,7 @@ let check_grammar p_grammar =
n with n > 0 is the number of parameters of the clique. n with n > 0 is the number of parameters of the clique.
*) *)
let unseen = -1 in let unseen = -1 in
let marked_components = Array.create n unseen in let marked_components = Array.make n unseen in
let flexible_arrow args = let flexible_arrow args =
let ty = Arrow (List.map (fun _ -> fresh_flexible_variable ()) args) in let ty = Arrow (List.map (fun _ -> fresh_flexible_variable ()) args) in
......
...@@ -67,7 +67,7 @@ end) = struct ...@@ -67,7 +67,7 @@ end) = struct
[data option], because we have no meaningful initial value of [data option], because we have no meaningful initial value of
type [data] at hand. *) type [data] at hand. *)
let table = Array.create G.n None in let table = Array.make G.n None in
(* Initialize the array. *) (* Initialize the array. *)
......
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