Commit 294515e6 authored by POTTIER Francois's avatar POTTIER Francois

Changed [compare] to [preferable] in [OnErrorReduce].

parent b972a0b2
......@@ -1493,7 +1493,8 @@ module OnErrorReduce = struct
open Precedence
let compare nt1 nt2 =
let preferable nt1 nt2 =
assert (nt1 <> nt2);
let prec1, prec2 =
try
StringMap.find (print nt1) declarations,
......@@ -1508,13 +1509,13 @@ module OnErrorReduce = struct
(* [prec1] is a higher integer than [prec2], therefore comes later
in the file. By analogy with [%left] and friends, we give higher
priority to later declarations. *)
Some nt1
true
| Lt ->
Some nt2
false
| Eq
| Ic ->
(* We could issue a warning or an information message in these cases. *)
None
false
end
......
......@@ -531,12 +531,12 @@ module OnErrorReduce : sig
val iter: (Nonterminal.t -> unit) -> unit
(* When two [%on_error_reduce] declarations are applicable in a single
state, they can be compared, using [compare], to test if one of them
state, they can be compared, using [preferable], to test if one of them
takes precedence over the other. This is a partial order; two symbols may
be incomparable (either because they appear one the same line, or because
be incomparable (either because they appear on the same line, or because
they originate in different files). *)
val compare: Nonterminal.t -> Nonterminal.t -> Nonterminal.t option
val preferable: Nonterminal.t -> Nonterminal.t -> bool
end
......
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