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
8f2e9733
Commit
8f2e9733
authored
Sep 20, 2011
by
Guillaume Melquiond
Browse files
When nothing can be colorized due to missing locations (e.g. lemmas),
fallback on colorizing the identifier.
parent
63f8633b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ide/gmain.ml
View file @
8f2e9733
...
...
@@ -1190,20 +1190,21 @@ let color_loc ~color loc =
if
f
=
!
current_file
then
color_loc
~
color
source_view
l
b
e
let
rec
color_locs
~
color
f
=
Util
.
option_iter
(
color_loc
~
color
)
f
.
Term
.
t_loc
;
Term
.
t_fold
(
fun
()
->
color_locs
~
color
)
()
f
let
b
=
ref
false
in
Util
.
option_iter
(
fun
loc
->
color_loc
~
color
loc
;
b
:=
true
)
f
.
Term
.
t_loc
;
Term
.
t_fold
(
fun
b
loc
->
color_locs
~
color
loc
||
b
)
!
b
f
(* FIXME: we shouldn't open binders _every_time_ we redraw screen!!!
No t_fold, no t_open_quant! *)
let
rec
color_t_locs
f
=
match
f
.
Term
.
t_node
with
|
Term
.
Tbinop
(
Term
.
Timplies
,
f1
,
f2
)
->
color_locs
~
color
:
premise_tag
f1
;
color_t_locs
f2
let
b
=
color_locs
~
color
:
premise_tag
f1
in
color_t_locs
f2
||
b
|
Term
.
Tlet
(
t
,
fb
)
->
let
_
,
f1
=
Term
.
t_open_bound
fb
in
color_locs
~
color
:
premise_tag
t
;
color_t_locs
f1
let
b
=
color_locs
~
color
:
premise_tag
t
in
color_t_locs
f1
||
b
|
Term
.
Tquant
(
Term
.
Tforall
,
fq
)
->
let
_
,_,
f1
=
Term
.
t_open_quant
fq
in
color_t_locs
f1
...
...
@@ -1219,7 +1220,8 @@ let scroll_to_source_goal g =
{
Task
.
task_decl
=
{
Theory
.
td_node
=
Theory
.
Decl
{
Decl
.
d_node
=
Decl
.
Dprop
(
Decl
.
Pgoal
,
_
,
f
)}}}
->
color_t_locs
f
if
not
(
color_t_locs
f
)
then
Util
.
option_iter
(
color_loc
~
color
:
goal_tag
)
id
.
Ident
.
id_loc
|
_
->
assert
false
...
...
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