Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
9c49c6da
Commit
9c49c6da
authored
Sep 28, 2018
by
Sylvain Dailler
Browse files
This adds model_projection meta to fields of records.
parent
2e437378
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/parser/parser.mly
View file @
9c49c6da
...
...
@@ -179,6 +179,25 @@
"Symbol %s cannot be user-defined. User-defined symbol cannot use ' \
before a letter. You can only use ' followed by _ or a number."
let
add_record_projections
(
d
:
Ptree
.
decl
)
=
let
meta_id
=
{
id_str
=
Theory
.(
meta_projection
.
meta_name
);
id_ats
=
[]
;
id_loc
=
Loc
.
dummy_position
}
in
match
d
with
|
Dtype
dl
->
List
.
iter
(
fun
td
->
match
td
.
td_def
with
|
TDrecord
fl
->
List
.
iter
(
fun
field
->
let
m
=
Dmeta
(
meta_id
,
[
Mfs
(
Qident
field
.
f_ident
)])
in
Typing
.
add_decl
field
.
f_loc
m
)
fl
|
_
->
()
)
dl
|
_
->
()
%
}
(* Tokens *)
...
...
@@ -302,7 +321,9 @@ module_decl:
|
IMPORT
uqualid
{
Typing
.
import_scope
(
floc
$
startpos
$
endpos
)
$
2
}
|
d
=
pure_decl
|
d
=
prog_decl
|
d
=
meta_decl
{
Typing
.
add_decl
(
floc
$
startpos
$
endpos
)
d
}
{
Typing
.
add_decl
(
floc
$
startpos
$
endpos
)
d
;
add_record_projections
d
}
|
use_clone
{
()
}
(* Use and clone *)
...
...
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