Commit 3c8caf01 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Exchange the arguments of [Production.foldnt].

parent 7fa6a0fd
...@@ -777,7 +777,7 @@ module Production = struct ...@@ -777,7 +777,7 @@ module Production = struct
let k, k' = ntprods.(nt) in let k, k' = ntprods.(nt) in
Misc.iterij k k' f Misc.iterij k k' f
let foldnt (nt : Nonterminal.t) (accu : 'a) (f : index -> 'a -> 'a) : 'a = let foldnt nt (f : index -> 'a -> 'a) accu =
let k, k' = ntprods.(nt) in let k, k' = ntprods.(nt) in
let rec loop accu prod = let rec loop accu prod =
if prod < k' then if prod < k' then
......
...@@ -459,7 +459,7 @@ module Production : sig ...@@ -459,7 +459,7 @@ module Production : sig
nonterminal. *) nonterminal. *)
val iternt: Nonterminal.t -> (index -> unit) -> unit val iternt: Nonterminal.t -> (index -> unit) -> unit
val foldnt: Nonterminal.t -> 'a -> (index -> 'a -> 'a) -> 'a val foldnt: Nonterminal.t -> (index -> 'a -> 'a) -> 'a -> 'a
val mapnt: Nonterminal.t -> (index -> 'a) -> 'a list val mapnt: Nonterminal.t -> (index -> 'a) -> 'a list
(* This allows determining whether a production is a start (* This allows determining whether a production is a start
......
...@@ -247,9 +247,9 @@ module Closure (L : Lookahead.S) = struct ...@@ -247,9 +247,9 @@ module Closure (L : Lookahead.S) = struct
if pos < length then if pos < length then
match rhs.(pos) with match rhs.(pos) with
| Symbol.N nt -> | Symbol.N nt ->
Production.foldnt nt [] (fun prod nodes -> Production.foldnt nt (fun prod nodes ->
(item2node (import (prod, 0))) :: nodes (item2node (import (prod, 0))) :: nodes
) ) []
| Symbol.T _ -> | Symbol.T _ ->
[] []
else else
......
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