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
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
25e8a869
Commit
25e8a869
authored
Oct 10, 2012
by
Claude Marche
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IDE: warnings displayed in one shot
parent
12cca92f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
21 deletions
+43
-21
src/ide/gmain.ml
src/ide/gmain.ml
+29
-18
src/session/termcode.ml
src/session/termcode.ml
+4
-1
src/transform/eliminate_definition.ml
src/transform/eliminate_definition.ml
+2
-2
tests/test-claude.why
tests/test-claude.why
+8
-0
No files found.
src/ide/gmain.ml
View file @
25e8a869
...
...
@@ -798,24 +798,33 @@ let info_window ?(callback=(fun () -> ())) mt s =
let
file_info
=
GMisc
.
label
~
text
:
""
~
packing
:
(
right_hb
#
pack
~
fill
:
true
)
()
let
warning_window
?
loc
msg
=
begin
match
loc
with
|
None
->
Format
.
fprintf
Format
.
str_formatter
"%s"
msg
|
Some
l
->
(* scroll_to_loc ~color:error_tag ~yalign:0.5 loc; *)
Format
.
fprintf
Format
.
str_formatter
"%a: %s"
Loc
.
gen_report_position
l
msg
end
;
let
msg
=
Format
.
flush_str_formatter
()
in
file_info
#
set_text
msg
;
info_window
`WARNING
msg
let
warnings
=
Queue
.
create
()
let
()
=
Warning
.
set_hook
warning_window
let
record_warning
?
loc
msg
=
Queue
.
push
(
loc
,
msg
)
warnings
let
()
=
Warning
.
set_hook
record_warning
let
display_warnings
()
=
if
Queue
.
is_empty
warnings
then
()
else
begin
Queue
.
iter
(
fun
(
loc
,
msg
)
->
match
loc
with
|
None
->
Format
.
fprintf
Format
.
str_formatter
"%s@
\n
"
msg
|
Some
l
->
(* scroll_to_loc ~color:error_tag ~yalign:0.5 loc; *)
Format
.
fprintf
Format
.
str_formatter
"%a: %s@
\n
"
Loc
.
gen_report_position
l
msg
)
warnings
;
Queue
.
clear
warnings
;
let
msg
=
Format
.
flush_str_formatter
()
in
(* file_info#set_text msg; *)
info_window
`WARNING
msg
end
(* check if provers are present *)
let
()
=
...
...
@@ -867,7 +876,8 @@ let () =
else
try
Debug
.
dprintf
debug
"[Info] adding file %s in database@."
fn
;
ignore
(
M
.
add_file
(
env_session
()
)
?
format
:!
opt_parser
fn
)
ignore
(
M
.
add_file
(
env_session
()
)
?
format
:!
opt_parser
fn
);
display_warnings
()
with
e
->
eprintf
"@[Error while reading file@ '%s':@ %a@.@]"
fn
Exn_printer
.
exn_printer
e
;
...
...
@@ -1122,7 +1132,8 @@ let select_file () =
let
f
=
Sysutil
.
relativize_filename
project_dir
f
in
Debug
.
dprintf
debug
"Adding file '%s'@."
f
;
try
ignore
(
M
.
add_file
(
env_session
()
)
f
)
ignore
(
M
.
add_file
(
env_session
()
)
f
);
display_warnings
()
with
e
->
fprintf
str_formatter
"@[Error while reading file@ '%s':@ %a@]"
f
...
...
src/session/termcode.ml
View file @
25e8a869
...
...
@@ -281,7 +281,7 @@ module type S = sig
val
name
:
t
->
Ident
.
ident
end
(*
module type Sold = sig
type t
val checksum : t -> string
...
...
@@ -289,7 +289,9 @@ module type Sold = sig
val id : t -> Ident.ident
(* .goal_name *)
end
*)
(*
module type Snew = sig
type t
val checksum : t -> string
...
...
@@ -311,6 +313,7 @@ module type Snew = sig
end
*)
(*************************************************************)
...
...
src/transform/eliminate_definition.ml
View file @
25e8a869
...
...
@@ -195,7 +195,7 @@ type bisect_step =
type
rem
=
{
rem_pr
:
Spr
.
t
;
rem_ls
:
Sls
.
t
;
rem_ts
:
Sts
.
t
}
let
print_rem
fmt
rem
=
Format
.
fprintf
fmt
let
_
print_rem
fmt
rem
=
Format
.
fprintf
fmt
"@[rem_pr:@[%a@]@
\n
rem_ls:@[%a@]@
\n
rem_ts:@[%a@]@
\n
"
(
Pp
.
print_iter1
Spr
.
iter
Pp
.
comma
Pretty
.
print_pr
)
rem
.
rem_pr
(
Pp
.
print_iter1
Sls
.
iter
Pp
.
comma
Pretty
.
print_ls
)
rem
.
rem_ls
...
...
@@ -228,7 +228,7 @@ let add_rem rem decl =
|
Dind
(
_
,
l
)
->
List
.
fold_left
(
fun
rem
(
ls
,_
)
->
remove_ls
rem
ls
)
rem
l
|
Dprop
(
_
,
pr
,_
)
->
remove_pr
rem
pr
let
union_rem
rem1
rem2
=
let
_
union_rem
rem1
rem2
=
{
rem_ts
=
Sts
.
union
rem1
.
rem_ts
rem2
.
rem_ts
;
rem_ls
=
Sls
.
union
rem1
.
rem_ls
rem2
.
rem_ls
;
rem_pr
=
Spr
.
union
rem1
.
rem_pr
rem2
.
rem_pr
;
...
...
tests/test-claude.why
View file @
25e8a869
...
...
@@ -219,4 +219,12 @@ inductive p (x:int) =
| C2 : let x=0 in p x
end
theory TestWarnings
type t
lemma L1 : forall x:t. true
lemma L2 : exists x:t. x=x -> false
end
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