Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
3ea369b3
Commit
3ea369b3
authored
Mar 31, 2017
by
POTTIER Francois
Browse files
Rename [drop] to [pop_many].
parent
037cbaa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Engine.ml
View file @
3ea369b3
...
...
@@ -4,7 +4,7 @@
(* *)
(* François Pottier, Inria Paris *)
(* Yann Régis-Gianas, PPS, Université Paris Diderot *)
(* *)
(*
*)
(* Copyright Inria. All rights reserved. This file is distributed under the *)
(* terms of the GNU Library General Public License version 2, with a *)
(* special exception on linking, as described in the file LICENSE. *)
...
...
@@ -825,17 +825,17 @@ module Make (T : TABLE) = struct
(* The following functions are compositions of [top] and [pop]. *)
let
rec
drop
i
env
=
let
rec
pop_many
i
env
=
if
i
=
0
then
Some
env
else
match
pop
env
with
|
None
->
None
|
Some
env
->
drop
(
i
-
1
)
env
pop_many
(
i
-
1
)
env
let
get
i
env
=
match
drop
i
env
with
match
pop_many
i
env
with
|
None
->
None
|
Some
env
->
...
...
src/IncrementalEngine.ml
View file @
3ea369b3
...
...
@@ -267,11 +267,11 @@ module type INCREMENTAL_ENGINE = sig
val
top
:
'
a
env
->
element
option
(* [
drop
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
(* [
pop_many
i env] pops [i] cells off the automaton's stack. This is done by
invoking [pop] [i] times in succession. Thus, [
pop_many
1] is [pop]. The
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
0-based: thus, [get 0] is [top]. If [i] is greater than or equal to the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment