Skip to content
GitLab
Menu
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
b00eac64
Commit
b00eac64
authored
Apr 07, 2017
by
POTTIER Francois
Browse files
Incremental API: rename [has_default_reduction] to [env_has_default_reduction].
parent
91b6b188
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGES.md
View file @
b00eac64
...
...
@@ -27,8 +27,10 @@
*
Improved the syntax error message that is displayed when a
`.mly`
file
is incorrect: the previous and next token are shown.
*
Possibly incompatible change in the incremental API: the type
`'a env`
becomes parameterized.
*
Incompatible change in the incremental API: the type
`env`
becomes
`'a env`
.
*
Incompatible change in the incremental API: the function
`has_default_reduction`
is renamed
`env_has_default_reduction`
.
*
The type
`stack`
and the function
`stack`
in the incremental API are
deprecated. The new functions
`top`
and
`pop`
can be used instead to
...
...
doc/main.tex
View file @
b00eac64
...
...
@@ -2529,10 +2529,10 @@ to \verb+main+.
%% val has_default_reduction
\begin{verbatim}
val has
_
default
_
reduction: 'a env -> bool
val
env
_
has
_
default
_
reduction: 'a env -> bool
\end{verbatim}
The function
\verb
+
has_default_reduction
+
The function
\verb
+
env_
has_default_reduction
+
tells whether the parser is about to perform a default reduction.
In particular, when applied to an environment
\verb
+
env
+
taken from a result of
the form
\verb
+
AboutToReduce (env, prod)
+
, it tells whether the reduction
...
...
src/Engine.ml
View file @
b00eac64
...
...
@@ -741,7 +741,7 @@ module Make (T : TABLE) = struct
(* We can make this a function of states, or a function of environments. For
now, the latter appears simpler. *)
let
has_default_reduction
env
:
bool
=
let
env_
has_default_reduction
env
:
bool
=
T
.
default_reduction
env
.
current
(
fun
_env
_prod
->
true
)
...
...
src/IncrementalEngine.ml
View file @
b00eac64
...
...
@@ -312,7 +312,7 @@ module type INCREMENTAL_ENGINE = sig
the form [AboutToReduce (env, prod)], this tells whether the reduction
that is about to take place is a default reduction. *)
val
has_default_reduction
:
'
a
env
->
bool
val
env_
has_default_reduction
:
'
a
env
->
bool
end
...
...
src/referenceInterpreter.ml
View file @
b00eac64
...
...
@@ -362,7 +362,7 @@ let check_error_path log nt input =
Furthermore, if a spurious reduction has taken place already,
then this is also a spurious reduction. *)
let
spurious
=
if
looking_at_last_token
()
&&
not
(
E
.
has_default_reduction
env
)
if
looking_at_last_token
()
&&
not
(
E
.
env_
has_default_reduction
env
)
||
spurious
<>
[]
then
(
current
env
,
prod
)
::
spurious
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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