Commit 3ea369b3 authored by POTTIER Francois's avatar POTTIER Francois

Rename [drop] to [pop_many].

parent 037cbaa3
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
(* *) (* *)
(* François Pottier, Inria Paris *) (* François Pottier, Inria Paris *)
(* Yann Régis-Gianas, PPS, Université Paris Diderot *) (* Yann Régis-Gianas, PPS, Université Paris Diderot *)
(* *) (* *)
(* Copyright Inria. All rights reserved. This file is distributed under the *) (* Copyright Inria. All rights reserved. This file is distributed under the *)
(* terms of the GNU Library General Public License version 2, with a *) (* terms of the GNU Library General Public License version 2, with a *)
(* special exception on linking, as described in the file LICENSE. *) (* special exception on linking, as described in the file LICENSE. *)
...@@ -825,17 +825,17 @@ module Make (T : TABLE) = struct ...@@ -825,17 +825,17 @@ module Make (T : TABLE) = struct
(* The following functions are compositions of [top] and [pop]. *) (* The following functions are compositions of [top] and [pop]. *)
let rec drop i env = let rec pop_many i env =
if i = 0 then if i = 0 then
Some env Some env
else match pop env with else match pop env with
| None -> | None ->
None None
| Some env -> | Some env ->
drop (i - 1) env pop_many (i - 1) env
let get i env = let get i env =
match drop i env with match pop_many i env with
| None -> | None ->
None None
| Some env -> | Some env ->
......
...@@ -267,11 +267,11 @@ module type INCREMENTAL_ENGINE = sig ...@@ -267,11 +267,11 @@ module type INCREMENTAL_ENGINE = sig
val top: 'a env -> element option val top: 'a env -> element option
(* [drop i env] pops [i] cells off the automaton's stack. This is done by (* [pop_many i env] pops [i] cells off the automaton's stack. This is done by
invoking [pop] [i] times in succession. Thus, [drop 1] is [pop]. The invoking [pop] [i] times in succession. Thus, [pop_many 1] is [pop]. The
index [i] must be nonnegative. The time complexity is O(i). *) index [i] must be nonnegative. The time complexity is O(i). *)
val drop: int -> 'a env -> 'a env option val pop_many: int -> 'a env -> 'a env option
(* [get i env] returns the parser's [i]-th stack cell. The index [i] is (* [get i env] returns the parser's [i]-th stack cell. The index [i] is
0-based: thus, [get 0] is [top]. If [i] is greater than or equal to the 0-based: thus, [get 0] is [top]. If [i] is greater than or equal to the
......
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