Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
menhir
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POTTIER Francois
menhir
Commits
1c93acea
Commit
1c93acea
authored
Mar 11, 2016
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code back-end: type annotations for values extracted out of the stack.
parent
d3b2538b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
CHANGES
CHANGES
+6
-0
src/codeBackend.ml
src/codeBackend.ml
+8
-4
No files found.
CHANGES
View file @
1c93acea
2016/03/11:
In the code back-end, generate type annotations when extracting a semantic
value out of the stack. When working with a semantic value of some function
type, OCaml would incorrectly warn that this function does not use its
argument. This warning should now be gone.
2016/03/03:
Makefile changes, so as to support ocamlbuild 4.03, which seems to have
stricter hygiene rules than previous versions.
...
...
src/codeBackend.ml
View file @
1c93acea
...
...
@@ -715,10 +715,14 @@ let runcellparams var holds_state symbol =
let
reducecellparams
prod
i
holds_state
symbol
=
let
ids
=
Production
.
identifiers
prod
in
(* The semantic value is bound to the variable [ids.(i)]. *)
let
semvpat
_t
=
PVar
ids
.
(
i
)
(* The semantic value is bound to the variable [ids.(i)]. Its type is [t]. As
of 2016/03/11, we generate a type annotation. Indeed, because of our use of
[magic], the semantic value would otherwise have an unknown type; and, if
it is a function, the OCaml compiler could warn (incorrectly) that this
function does not use its argument. *)
let
semvpat
t
=
PAnnot
(
PVar
ids
.
(
i
)
,
t
)
in
elementif
(
Invariant
.
endp
symbol
)
(
PVar
(
Printf
.
sprintf
"_endpos_%s_"
ids
.
(
i
)))
@
...
...
Write
Preview
Markdown
is supported
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