Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
0ff3bb14
Commit
0ff3bb14
authored
9 months ago
by
Loïc Correnson
Committed by
Virgile Prevosto
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[modules] no more need to import module types
parent
a2e86c94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_internals/parsing/logic_parser.mly
+7
-22
7 additions, 22 deletions
src/kernel_internals/parsing/logic_parser.mly
with
7 additions
and
22 deletions
src/kernel_internals/parsing/logic_parser.mly
+
7
−
22
View file @
0ff3bb14
...
@@ -89,31 +89,16 @@
...
@@ -89,31 +89,16 @@
let
module_stack
=
Stack
.
create
()
let
module_stack
=
Stack
.
create
()
let
module_types
=
Hashtbl
.
create
0
let
module_types
=
Hashtbl
.
create
0
let
push_typename
?
(
export
=
true
)
t
=
let
push_typename
t
=
Logic_env
.
add_typename
t
;
Logic_env
.
add_typename
t
;
try
try
let
m
=
Stack
.
top
module_stack
in
let
m
=
Stack
.
top
module_stack
in
Hashtbl
.
add
module_types
m
(
export
,
t
)
Hashtbl
.
add
module_types
m
t
with
Stack
.
Empty
->
()
with
Stack
.
Empty
->
()
let
import_typenames
mId
asId
=
List
.
iter
(
fun
(
export
,
t
)
->
if
export
then
begin
push_typename
~
export
:
false
t
;
match
asId
with
|
None
->
()
|
Some
a
->
push_typename
~
export
:
false
@@
Printf
.
sprintf
"%s::%s"
a
t
end
)
@@
Hashtbl
.
find_all
module_types
mId
let
pop_module_types
()
=
let
pop_module_types
()
=
let
m
=
Stack
.
pop
module_stack
in
let
m
=
Stack
.
pop
module_stack
in
List
.
iter
(
fun
(
export
,
t
)
->
List
.
iter
Logic_env
.
remove_typename
@@
Hashtbl
.
find_all
module_types
m
Logic_env
.
remove_typename
t
;
if
export
then
Logic_env
.
add_typename
(
Printf
.
sprintf
"%s::%s"
m
t
)
)
@@
Hashtbl
.
find_all
module_types
m
let
type_variables_stack
=
Stack
.
create
()
let
type_variables_stack
=
Stack
.
create
()
...
@@ -1696,10 +1681,10 @@ logic_def:
...
@@ -1696,10 +1681,10 @@ logic_def:
{
LDaxiomatic
(
$
2
,$
4
)
}
{
LDaxiomatic
(
$
2
,$
4
)
}
|
MODULE
push_module_identifier
LBRACE
logic_decls
RBRACE
|
MODULE
push_module_identifier
LBRACE
logic_decls
RBRACE
{
pop_module_types
()
;
LDmodule
(
$
2
,$
4
)
}
{
pop_module_types
()
;
LDmodule
(
$
2
,$
4
)
}
|
IMPORT
LONGIDENT
SEMICOLON
|
IMPORT
mId
=
LONGIDENT
SEMICOLON
{
import_typenames
$
2
None
;
LDimport
(
$
2
,
None
)
}
{
LDimport
(
mId
,
None
)
}
|
IMPORT
LONGIDENT
AS
identifier
SEMICOLON
|
IMPORT
mId
=
LONGIDENT
AS
asId
=
identifier
SEMICOLON
{
let
asId
=
Some
$
4
in
import_typenames
$
2
asId
;
LDimport
(
$
2
,
asId
)
}
{
LDimport
(
mId
,
Some
asId
)
}
|
TYPE
poly_id_type_add_typename
EQUAL
typedef
SEMICOLON
|
TYPE
poly_id_type_add_typename
EQUAL
typedef
SEMICOLON
{
let
(
id
,
tvars
)
=
$
2
in
{
let
(
id
,
tvars
)
=
$
2
in
exit_type_variables_scope
()
;
exit_type_variables_scope
()
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment